MarkupToUnstyled-Talk
This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.
Comments
Patch to add a space character between joined lines
SteP January 15, 2010, at 02:48 PM: Function MarkupToUnstyled leaves no space between lines when it joins them together. If you prefer adding a space character here is a patch that will do it. Tested on PmWiki 2.2.8.
// evaluate markup $text = MarkupToHTML($pagename, $text); //begin=add{ // replace <br /> and runs of newlines with a space $text = preg_replace(':<br />|\\n+:s', ' ', $text); //end-add} //delete // remove newlines //delete $text = preg_replace('/\\n/s', '', $text); // remove html tags $text = preg_replace('/<.*?>/s', '', $text);
Patch to suppress attached images and neuter intermaps
SteP January 15, 2010, at 02:48 PM: By default function MarkupToUnstyledLinkSuppress replaces all links with their text, which basically leaves intermaps, such as Attach:
enabled. Therefore the unstyled output will still show attached images. A simple work-around is shown below. It removes the intermap prefix from all types of links, and it deletes Attach links in particular. Note: this patch deletes all Attach links, not just images.
function MarkupToUnstyledLinkSuppress($pagename,$imap,$path,$title,$txt,$fmt=NULL) { return ($imap=='Attach:') ?'' :preg_replace("/^$imap/","",$txt); } //Step# delete Attach links and prevent intermap link expansion
Talk page for the MarkupToUnstyled recipe (users?).