[dokuwiki] Re: & entities

  • From: Eddie Kohler <kohler@xxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 15 Feb 2006 09:14:52 -0800

Chris, thanks for the further explanation! It had not occurred to me to add entries like &#7e; &#7e;.

I'll be a little more specific about what I am looking for. I have some marked-up text -- essentially a man page -- and want a script that generates Dokuwiki source that renders appropriately. That means I need wiki markup, and %%...%% and <nowiki>...</nowiki> do not work as far as I know. But I also need to avoid wiki markup where it doesn't belong: if, for some reason, the document source has a word in double stars, those stars should be displayed, not interpreted. The cleanest way to do this in a script seemed to be to escape possible syntax characters. Another advantage of doing this with entities is that humans can likewise selectively avoid wiki syntax.

If there is a better way I'd appreciate hearing about it.

Although extending the parser to accept entities still seems like the right thing to me, I'll go ahead and add entries to entities.local.conf for Dokuwiki syntax characters. Perhaps it would make sense to enter them in the main entities.conf eventually?

Thanks again!
Eddie



Chris Smith wrote:
Hi,

I understood that. Dokuwiki (dev version) has a character picker included in the editor. Dokuwiki uses utf-8 throughout, so special characters can be placed directly in the text. Most people don't know html entity codes off the top of their heads but can pick a character to place in the text. For me, that adds up to plenty of reason not to extend the syntax patterns of the parser to recognise entities. For those people/wikis that do have a requirement to handle entities surely a plugin or a entities.local.conf would solve their problem.

Cheers,

Chris

Notes:
[1] Entry in entities.local.conf could be as simple as &#7e; &#7e;
[2] Use %% ... %%, <nowiki>..</nowiki> or indent the lines by at least two spaces to avoid having text interpreted as syntax.



Eddie Kohler wrote:

Chris, this is not defining new syntax entities (like replacing >> with &laquo;), but about recognizing and preserving entities in the source (i.e., if the user types "&#7E;", leave that as "&#7E;" in the HTML output, rather than quoting it to "&amp;#7E;"). Among other things, this gives you a way to programmatically quote text that might be misinterpreted as wiki syntax.


On Feb 14, 2006, at 4:52 PM, Chris Smith wrote:

Eddie Kohler wrote:

Hi all,

I've written a patch that allows &whatever; entities to make it through to HTML. Other &s are quoted as usual. Would this be generally useful? Had someone else done it already?

Thanks,
Eddie

--DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

You can define entity codes in conf/entities.local.conf

Personally, I don't think a patch is appropriate, but a syntax plugin would be suitable.

Cheers,

Chris
--DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist


--DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist


--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: