Opened 3 years ago
Closed 3 years ago
#14027 closed enhancement (fixed)
Use ''Code fences'' syntax for WikiProcessors
Reported by: | Cinc-th | Owned by: | Cinc-th |
---|---|---|---|
Priority: | normal | Component: | MarkdownMacro |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.4 |
Description
WikiProcessors are supported with Trac syntax:
{{{#!python Foo = 1 }}}
This breaks compatibility with other Markdown editors when exported. The processor will be printed in other editors like this:
{{{#!python Foo = 1 }}}
Code fences are supported by the macro but the rendering is not nice and no syntax highlighting is currently enabled.
By replacing Trac syntax any WikiProcessor will be rendered properly as a code block when editing Markdown text in another editor.
Changes
To aim for better compatibility with other tools the following should be implemented.
- Support Code fences with language specifiers:
```python # Python code here... ```
- Use code fence syntax for Trac WikiProcessors:
```diff --- Version 55 +++ Version 56 @@ -115,8 +115,9 @@ name='TracHelloWorld', version='1.0', packages=find_packages(exclude=['*.tests*']), - entry_points = """ - [trac.plugins] - helloworld = myplugs.helloworld - """, + entry_points = { + 'trac.plugins': [ + 'helloworld = myplugs.helloworld', + ], + }, ) ```
instead of:{{{#!diff ... }}}
This can easily be achieved in a preprocessor extension by replacing code fences with Trac syntax which is subsequently interpreted by the wiki processor extension already implemented.
Another way is by directly replacing the code fence extension with one using Trac as the rendering backend.
Attachments (0)
Change History (3)
comment:1 Changed 3 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:2 Changed 3 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Code fences without any language specification no longer work.
``` Some text ```
is rendered as
{{#! Some text }}}
In 18332: