LiteralWhiteSpace-Talk

Summary: Talk page for LiteralWhiteSpace.
Maintainer: HansB
Users: +3 (View / Edit)

This 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.

 

Avatar is the result of many years of work and play by
literally hundreds of people.  We hope that you enjoy
playing the game as much as we have enjoyed creating it.


The game offers fun to the beginner and has enough
complexity to keep the expert challenged.  One of the
most important aspects of the game is the interaction
between the players.  The players make this game.

The game is based on many "dungeon games" that have
come before it and adds many new ideas.  There is no
absolute goal to the game; the players generally make
their own goals.  You will probably pick and change
goals throughout your lifetime in the game.

Avatar is the result of many years of work and play by
literally hundreds of people.  We hope that you enjoy
playing the game as much as we have enjoyed creating it.

 

 

The game offers fun to the beginner and has enough
complexity to keep the expert challenged.  One of the
most important aspects of the game is the interaction
between the players.  The players make this game.

 

The game is based on many "dungeon games" that have
come before it and adds many new ideas.  There is no
absolute goal to the game; the players generally make
their own goals.  You will probably pick and change
goals throughout your lifetime in the game.

 

Don't delete the markup markup. It differentiates content from the example.  -- gnuzoo
HansB: gnuzoo, the script enabled here is not the same as my latest version. It also does not quite work, see my example below. If you have trouble on your site please check the skin css. What skin do you use? Might it work with pmwiki standard skin (no $Skin var set)?


Here whitespace-php7.phpΔ is enabled. --Petko
This version has some differences to the newest updated whitespace.phpΔ --HansB


HansB: I am confused as to what version is enabled where: the Talk page and the Recipe page.
The whitespace-php7.php version was enabled on LiteralWhiteSpace, now also here on the talk page. It has some line-height and spacing configured that don't match what is enabled in the skin, so the lines in your table cells were not aligned. Here are the corrected styles. --Petko

 $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 >>-<< is used? I also switched in the vspace markup definition <p class='vspace'>&nbsp;</p> to <div class='vspace'></div>, which I am not sure is an improvement or not (avoiding the &nsp; additions):
Using table with two cells. There should be line alignment.

(:table:)
(:cell:)
1
2
3
4
5
6
7
8
9
10
11
(:cell:)
1. first text line
2. second text line

   4. third indented text line, one empty line above


7. two empty lines above
>>-<<
9. half height empty line above
>>-<<
10. half height empty line above
(:tableend:) 

1
2
3
4
5
6
7
8
9
10
11

1. first text line
2. second text line

 


   4. third indented text line, one empty line above

 

 

7. two empty lines above

9. half height empty line above

10. half height empty line above


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";


Please fix this. --gnuzoo
HansB: thanks for noticing. removed that debug snippet. 2024-04-12


> bug which adds an extra empty line if a new paragraph after an empty line starts with empty spaces at the beginning of the line.
Instead of solving the problem of not having to use ugly markup all over the place, this recipe bug introduces too much whitespace which can be just as annoying and impossible to remove.  Petko, can you please fix this bug? --gnuzoo
HansB: Fixed with latest update. 2024-03-17


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
HansB: PmWiki adds vertical space under heading 4 !!!!Normal Text, and you add an extra empty line space, therefore you got too much vspace. - 2024-04-24


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
(Ross Grady, Nov 8, 2015)
You probably don't need to quote $m[1], see the corrected lines of code. --Petko November 08, 2015, at 11:50 AM


Near the middle of this script there is a commented out line of code:

    # honour empty lines
    #Markup(':vspace', 'fulltext','/<:vspace>/',"<p class='vspace'>&nbsp;</p>");

Why is this commented out?  PMWiki does not allow more than 1 break. (PITS 1503) Do you know how to fix that? --gnuzoo
HansB: Fixed in update 2024-04-24


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?

  • Well, you can also use [@preformatted text block@] markup if this is all you want to do - you don't need this recipe. See the text formatting rules.        Francis
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.

See GroupCustomizations. It also explains per page customisations. You would need to include the recipe on  a local Group.PageName.php file. HansB

--- 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
Thanks. Yes I've been using tables for this layout, but unfortunately, there's lots of entries on the page and it takes forever to load with tables. I was looking for a better way to lay it out, w/o tables but I guess the only feasible solution would be that or monospaced text, which really doesn't do it for me ;)

Talk page for the LiteralWhiteSpace recipe (users).