Adeodato Simó wrote: > While migrating my site to use prefix directives, after rebuilt I > noticed a smelly diff in one blog entry involving several \[[ escapes.
Markdown removes \ from markdown documents, except when it's backquoted or in a pre block or similar. > In particular: > > * when rendering a page, if the \[[ is between `backticks` and not > ]]-closed in the same line, the backslash is emitted in the html > output. `\[[foo bar]]` With prefix_directives enabled, this is not a preprocessor directive, or a wikilink. Therefore, it's passed through unchanged to markdown, which preserves the slash, since it's in backquotes. > This works with prefix_directives disabled. Then it is an escaped preprocessor directive, so ikiwiki removes the slash. If you used `\[[!foo bar]]` you would get the same behavior with and without preprocessor directives enabled, since in either case it's a preprocessor directive. > * for \[[ escapes that are closed in the same line, and *only* when > inlining, the opening and closing double brackets are not emitted. This is a real bug. This occurs because inlined pages are linkified twice, once before inlining and once when rendering the final page. In the first pass, "\[[foo]]" is changed to "[[foo]]", and in the second pass this is treated as wiki markup. -- see shy jo
signature.asc
Description: Digital signature