PmWiki
|
March 31, 2025, at 07:02 AM | Cookbook / LiteralWhiteSpace-Talk |
|
LiteralWhiteSpace-TalkThis space is for User-contributed commentary and notes. Please include your name and a date along with your comment. This works. Something I do in my config or css must be interfering. Below is a Markup example to show that it works.
Don't delete the markup markup. It differentiates content from the example. -- gnuzoo
Here whitespace-php7.phpΔ is enabled. --Petko
HansB: I am confused as to what version is enabled where: the Talk page and the Recipe page.
$HTMLStylesFmt['vspace'] = " .halfline { height: 10px; font-size: 10px; line-height: 1;} .vspace { margin-top:0; line-height: inherit; } "; HansB: thanks Petko! But the whitespace-php7.php version does not contain the fix I added for th ebug which adds an extra empty line above if the paragraph starts with a text indent (empty space(s) at start of line). I fixed that in version 2024-03-17. And in the latest I tried to fix vertical spacing for extra empty lines, and tried to get vspace alignment more precise. But yes, it depends a lot on the skin css as well. I include example here [and what produces the grey stroke lines when half-line markup
May have found a BUG. I was just wiki-ing away and saw in the upper left corner of my wiki it displays "depth=1depth=1". I think it is from line number 58 in this recipe. if (@$MarkupFrame[0]['is'][$depth] == $icol) { echo "depth=$depth";
I put 2 paragaphs under "Normal text ↑" in the sandbox on the main page and it puts too much vertical whitespace in front of the 2 paragraphs. --gnuzoo
This no longer works under php 5.5, although the fixes are trivial. In toto, they are: diff whitespace.php whitespace.bak 27c27 < Markup('^ws', '<^img', '/^(\\s+)(.*?)/', "WSIndent2($m[1])"); --- > Markup('^ws', '<^img', '/^(\\s+)(.*?)/e', "WSIndent2('$1')"); 46c46 < Markup('spacing', '>style', "/(\\s{2,7})(?![^<]*>)/", "WSReplace($m[1])"); --- > Markup('spacing', '>style', "/(\\s{2,7})(?![^<]*>)/e", "WSReplace('$1')");
update: spoke too soon. Will have to revisit
Near the middle of this script there is a commented out line of code: # honour empty lines #Markup(':vspace', 'fulltext','/<:vspace>/',"<p class='vspace'> </p>"); Why is this commented out? PMWiki does not allow more than 1 break. (PITS 1503) Do you know how to fix that? --gnuzoo
It would be really nice if this recipe defined a new markups to turn itself on and off for pages or sections of pages. Or does it does do this already, and I'm just missing it? Francis No there is no markup at present to disable all these markup rules, apart from the (:nolinebreaks:) markup. Perhaps I can create one. HansB
How can I paste content into a page, which originates from emails and word processors, where text spacing is achieved by using spaces, tabs and empty lines?
But then you are getting monospaced font. And if you paste in whole long paragraphs from a wordprocessor you get too wide lines and break the layout. HansB
Is there any way to use this recipe (or any other recipe for that matter) on certain pages only? I love the recipe and have been waiting for something like that for a long time, but I only need it on specific pages.
--- Thanks. Also, I tried pasting a formatted, tabbed text from a word document and the formatting was not even close to the original. Am I missing something ?? G. Can you demonstrate this here below in the Sandbox area? LiteralWhiteSpace is enabled on this page. HansB
Sure. I have included a sample in the sandbox.
Tabs are translated as a HTML span tag with class=indent. This is a fixed number of characters per tab, exactly what you see. Tabs fail when they are used not at the beginning of lines, but inside line text. I think the only way to achieve a tabular layout is to use tables. But the literal whitespace markups does not provide a translation into tables. This would be very difficult to achieve, if at all, I guess. HansB
Talk page for the LiteralWhiteSpace recipe (users). |
Modified: April 24, 2024, at 08:36 PM | RecentChanges | AllRecentChanges |