A simple plugin that allows for two spaces between content sentences if the user types two spaces rather than one
Compatible with DokuWiki
A simple plugin that allows for two spaces between content sentences if the user types two spaces rather than one
Similar to replace, strreplace
PHP 7+ required.
Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.
There is no configuraton required.
Edit your Dokuwiki pages as you normally would. If you only use single spaces, then nothing changes whatsoever.
If you enter more than one space after a sentence then the text will be replaced by a space followed by a nonbreaking space entity (
) so that two spaces will be rendered in the final text.
Currently, the spaces are placed after the following characters followed by two or more spaces:
potentially followed by the characters:
Note that the colon may not precede a closing parenthesis, only the other symbols.
The follow-up characters are important because if you enter a parenthetical and it is the end of a sentence, you still want double spacing after it. Also, in Dokuwiki syntax you often have square or curly braces around text to denote links or styling, and they may fall at the end of a sentence.
I find it's far easier to skim text if I have better clues about where sentences begin and end with extra whitespace, but HTML takes that away from me by collapsing multiple spaces into a single space unless I specifically make a non-breaking space entity or character. Since I have several wikis I maintain, I figured it'd be nice if I could “spread out” the sentences to make the content easier to look over at a glance.
syntax.php
.typography
to save it. (Basically, no matter what you put in the typography
configuration, I set it to zero after saving another copy to $conf
, and then handle the generation of curly quotes in an event handler on my side using whatever you had originally set. Hideous hack, but it works.) None known.
If you find a bug, please submit a report at the project's github.