Not logged in. · Lost password · Register
Forum: General Help and Support Syntax and Usage RSS
[released] "%%" no-formating would skip spaces at string-beginning
Page:  1  2  next 
Avatar
Samana Johann #1
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
Subject: [released] "%%" no-formating would skip spaces at string-beginning
Valued DW-team and user,

the "tag" %%, for no formating text-parts would skip (not show) white-spaces at the strings beginning. Not sure if intented on one hand, and possible work-around to display code-parts in a <span> are surely interested.

(Thought of adding that on the dw-syntax page, but had no access.)
This post was edited on 2018-09-23, 11:28 by Samana Johann.
Avatar
Michaelsy #2
Member since Jun 2015 · 569 posts · Location: Düsseldorf, Germany
Group memberships: Members
Show profile · Link to this post
Please give an example of which output do you want. If possible in the form of HTML-Code. Maybe in form of a screenshot of a Word Document or a graphical software.
By Patreon.com a few eurons can be fed into the code phasers of
the DokuWiki engine. Besides, Andi's posts are worth reading.
This post was edited 2 times, last on 2018-09-22, 09:24 by Michaelsy.
Avatar
Samana Johann #3
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
Sure Mr. Michaelsy, trusting to be able to provide all needed:

My Person came across this trying to display this:

to reproduce sample (second was the original, first is the work-around
''%%__?_...%%'', ''%%  ? ...%%''

Display (maybe a html-issue): |? ...| (no spaces before ?)

It can be seen at http://accesstoinsight.eu/de/import_zze

html looks like that after prasing:

<tr class="row7">
        <td class="col0"><code>&lt;dt&gt;...&lt;/dt&gt;</code> </td><td class="col1"><code>__?_...</code>, <code>  ? ...</code> (zwei Leerzeichen vor, eines nach <code>?</code> </td>

screenshort attached.

May it be of use and help for good undertakings.
The author has attached one file to this post:
Screenshot_2018-09-22-23-05-21.jpeg 139.1 kBytes
You have no permission to open this file.
This post was edited on 2018-09-22, 19:07 by Samana Johann.
Avatar
Michaelsy #4
Member since Jun 2015 · 569 posts · Location: Düsseldorf, Germany
Group memberships: Members
Show profile · Link to this post
The %%....%% syntax is not intended for what you want.

The solution for you, take the following line into the file conf/entities.local.conf - create the file if does not exist:

\_   &nbsp;

After that you can insert so called No-Branch-SPace-Entities into your wiki code (at every position and as often as you want):

''\_\_? ...''

But you must not code something like this:

''%%\_\_? ...%%''

Because %%...%% is intended to prevent the replacement of \_ with the HTML-Entity &nbsp;

Feedback welcome
   - Michael Sy.
By Patreon.com a few eurons can be fed into the code phasers of
the DokuWiki engine. Besides, Andi's posts are worth reading.
This post was edited on 2018-09-22, 20:25 by Michaelsy.
Avatar
Samana Johann #5
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
Sadhu (appreciation) for the huge generosity.

My person did not want to get that far to make such as a replacement for spaces. Using underline was just the way he worked around the issue that the <code>-tag cuts away spaces at the beginning of a string and thought that in cases of codes it would be not good if doing so.

Hope my person could transport the issue better now and appreciates the patient.
Avatar
Michaelsy #6
Member since Jun 2015 · 569 posts · Location: Düsseldorf, Germany
Group memberships: Members
Show profile · Link to this post
Is there a misunderstanding? I'm not sure to understand what you mean. (Sorry I'm only a german native speaker)
 
to make such as a replacement for spaces

My solution is not a replacement for spaces.

It is a insertion of (e. g. leading and more than one) spaces.
By Patreon.com a few eurons can be fed into the code phasers of
the DokuWiki engine. Besides, Andi's posts are worth reading.
The author has attached one file to this post:
nbsp.png 4 kBytes
You have no permission to open this file.
This post was edited 2 times, last on 2018-09-23, 10:50 by Michaelsy.
Avatar
LarsDW223 #7
Member since Sep 2014 · 344 posts · Location: Paderborn
Group memberships: Members
Show profile · Link to this post
@Samana:
If I understood it right, the issue is that there is actually no posibility to add text spans which preserve spaces. The code tag is preserving spaces but only creates new paragraphs. The monospace tag looks like adding code spans but is not preserving space.

If that is what you want then please test the little plugin I wrote. It's not published yet, so you need to install it manually from https://github.com/LarsGit223/dokuwiki-plugin-prespan/arch….

Just use it like this:

Some text with some <prespan>    code     part</prespan>.

This will preserve the spaces and nothing more - that means it will not be monospaced. But you can combine it with any other formatting style: monospace, underline, italic...

Let me know if this is helpful for you - then I will publish it and create a page at dokuwiki.org.
Avatar
Samana Johann #8
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
In reply to post #6
Mr. Michael,

So one could say: Within the %%-tag, which generates the html <code>-tag, spaces at the beginning are not displayed (may it be an html or an css, or a prasing issue). If one likes to work around this disadvantage one could use "_" (underline for spaces at the begining of a strinstring and

Mr. Michael:

The solution for you, take the following line into the file conf/entities.local.conf - create the file if does not exist:

\_   &nbsp;

After that you can insert so called No-Branch-SPace-Entities into your wiki code (at every position and as often as you want):

''\_\_? ...''

(My persons english is surely the most terrible, so no need to worry at all in regard of this. The misunderstanding is not found in normal language but in my persons lack of IT-language and it's (the issue) is totally no problem to live with it. Some will appreciate the alternative solution generously given here.)
Avatar
Michaelsy #9
Member since Jun 2015 · 569 posts · Location: Düsseldorf, Germany
Group memberships: Members
Show profile · Link to this post
In reply to post #7
Yes, the solution which is present by LarsDW223 is another way for the same final result as my solution.

It surely works with the CSS attribute: white-space: pre (But that's not important for the user.)
By Patreon.com a few eurons can be fed into the code phasers of
the DokuWiki engine. Besides, Andi's posts are worth reading.
Avatar
Samana Johann #10
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
In reply to post #7
Quote by LarsDW223:
@Samana:
If I understood it right, ...

Sadhu (appreciation, "Well done", e.g. the act of following a generous mind).

Guess that matches the op's issue, my person thought of sharing.

Good intended deeds help formost the doer. My person is sure that some will be able to receive even Lars further gifts and feel good to got in debt with good intention of not wishing something directly in exchange.

As for my person, he will forward his gift here as well, leave it to those skilled in implementing plugins.

(Possible good if the "disadvantage" and work-around is mentioned on dw-syntax page as well)

Solution of topic issue generously provided by Mr. Lars and Mr. Michael.
This post was edited on 2018-09-23, 11:27 by Samana Johann.
Avatar
Michaelsy #11
Member since Jun 2015 · 569 posts · Location: Düsseldorf, Germany
Group memberships: Members
Show profile · Link to this post
Within the %%-tag, which generates the html <code>-tag,

For clarification: The %%...%% syntax does not generate the HTML <code>-tag. It suppress all wiki code to interpret and render as wiki code. (That means all wiki code is shown as it is written). It is exactly the same as <nowiki>...</nowiki>.
By Patreon.com a few eurons can be fed into the code phasers of
the DokuWiki engine. Besides, Andi's posts are worth reading.
This post was edited on 2018-09-23, 11:59 by Michaelsy.
Avatar
Samana Johann #12
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
So it's actually a html-issue: <code>-tag does not prevent of the general html behavious to cut away all spaces more then one. w3school gives: code-tag "Defines a piece of computer code". (thought such should not do such as cutting away spaces) althought '' and not %% renders it, if understood right.

dw tag '' provides the <code>-tag, used for merely layout. dw tag %% suppresses the execution of parsing dw-tags.

So propably the default front-family of monospace in the css is not really proper for a "code" tag.

(certainly worry about becoming split-minded (brained) step by step :-) , giving rise to gratitude for those sacrificing so much for smoot use of all one uses with mostly less concern. Sadhu)
This post was edited 3 times, last on 2018-09-23, 12:43 by Samana Johann.
Avatar
Michaelsy #13
Member since Jun 2015 · 569 posts · Location: Düsseldorf, Germany
Group memberships: Members
Show profile · Link to this post
In reply to post #7
Quote by LarsDW223:
then I will publish it and create a page at dokuwiki.org.

Maybe it make sense to add a short form for your prespan / inline-pre?

Something like this:
Blah blah ![   these are   many     spaces!  ]! blah blah
By Patreon.com a few eurons can be fed into the code phasers of
the DokuWiki engine. Besides, Andi's posts are worth reading.
This post was edited 3 times, last on 2018-09-23, 13:05 by Michaelsy.
Avatar
Samana Johann #14
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
To cut off even parts of others possibility of selfless deeds and gain a lot of merits would be a fault and it's not proper for an recluse/beggar to make exchange of generosity. Not even Devas (just gods) would do such. Leaving the possibility in helping of doing merits for others behind.

(but of course to appreciate the concern and to care about ones fellows needs, Mr. Michael. Sadhu)

Addition: and already done: Sadhu and mudita
This post was edited on 2018-09-23, 12:52 by Samana Johann.
Avatar
LarsDW223 #15
Member since Sep 2014 · 344 posts · Location: Paderborn
Group memberships: Members
Show profile · Link to this post
In reply to post #13
...
dw tag '' provides the <code>-tag, used for merely layout. dw tag %% suppresses the execution of parsing dw-tags.

So propably the default front-family of monospace in the css is not really proper for a "code" tag.
...

To prevent some misunderstanding here, some more clarification:

The DokuWiki code tag is converted by DokuWiki's XHTML renderer into the HTML tag pre. The pre element automatically preserves spaces and use a fixed-width font. Also see https://www.w3schools.com/tags/tag_pre.asp. Also DokuWiki passes the source code between the code tags to GeShi which provides syntax highlighting if a language is given in the DokuWiki code tag.

The font-family does not influence HTML's behaviour about preserving spaces or not.

That's why the monospace tag for text spans alone will not preserve spaces.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  1  2  next 
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2018-12-16, 07:56:07 (UTC +01:00)