BasicEditing-Talk

Remove <p> tags

Is there any way to prevent PmWiki to add <p> tag? Thank you!

Hemiola?

Yes, however in some cases this might cause non-standard HTML, or styling issues. You can either replace the <p> tags with <div>, or add a custom markup to remove the tags in specific places like menus. Add to config.php:

# Replace <p> with <div>
$BlockMarkups['p'] = array('<div>','','</div>',0);

Note that this will change the way PmWiki outputs vertical white space (between subsequent paragraphs):

Originally:
<p class='vspace'>Paragraph</p>

After the change:
<div class="vspace"></div>
<div>Paragraph</div>

To add a markup (:nop:) removing a specific <p></p> tag, add to config.php:

Markup('nop', '<block', '/^\\(:nop:\\)/', '<:block>');

Then in a wiki page, do something like:

>>frame menu<<
(:nop:) This is a direct child of the div.frame.menu above, no <p>
>><<

Maybe this deserves a Cookbook page. UpdateMe --Petko


Link title attributes

There needs to be something about setting the HTML title element on links. The title attribute also works as a tooltip.

Examples show the title attribute set in image links in double quotes adjacent to the right side of the image file reference.

[[URL|image"title attribute text"]]

see: https://www.pmwiki.org/wiki/PmWiki/Images#links

This will not work for a text link. I had an extremely difficult time finding that this works for a text link by putting the title attribute text in double quotes adjacent to the left side of the URL

[[https://pmwiki.org"title attribute text"|PMWiki]]

This works - mouse over the link and see the tooltip:

[[https://pmwiki.org"title attribute text is here"|PMWiki with HTML title attribute set]]

PMWiki with HTML title attribute set

This will not work:

[[https://pmwiki.org|PMWiki with HTML title attribute set"no title attribute text is here"]]

PMWiki with HTML title attribute set"no title attribute text is here"

I also found the title/tooltip being adjacent to the URL appears to work too.

gnuzoo

Someone didn't consider this to be "basic", so it is documented in Links#tooltiptitle. In fact, Attach: with a picture was implemented by Pm, then later I added it for external links, and even later for page links. The "Attach:" prefix is an InterMap prefix for PmWiki (like "https:") so these use the same logic. --Petko


This is a talk page for improving PmWiki.BasicEditing.