This question about Using an extension: Asked

Markdown and Foswiki macros. Some questions.

The MarkdownPlugin supports the rendering of markdown. The approach is through selecting a section of text and rendering the markdown as html. The selection can occur in a variety of ways, but can be summarised as:
  • text between %STARTMARKDOWN% and %STOPMARKDOWN% macros is expanded.

Between the markers
  • Simple Foswiki macros like %DATE%, %WEBSUMMARY% etc are expanded.
  • More complex macros like INCLUDE, SEARCH, SERVERINFORMATION, etc are expanded, but do not always render correctly.

The first reason for this issue is that the expansion of the macro is successfully completed, but the results of the processing between the START/STOPMARKDOWN markers returns the result between <literal> and </literal> markers, protecting the text from rendering.

Question: Why is this?

I can address this by removing the <literal> and </literal> tags.

When I remove the literal tags, the rendering works with some minor issues:
  • INCLUDING a topic with Markdown text remains markdown. The markdown is not rendered.
    • Adding START/STOPMARKDOWN macros around the text to be included does not help. The macros as well as the markdown are rendered as uninterpreted text.

Question: Is this because the START/STOPMARKDOWN tags are handled by the beforeCommonTagsHandler? Why not define STARTMARKDOWN as a regular tag and let the handler look for the STOPMARKDOWN tag?

I can fix this issue by adding a call to expandCommonVariables inside the sub handleMarkdownArea, but the documentation warns against this.

Any advice?

-- BramVanOosterhout - 02 Nov 2022

 

QuestionForm edit

Subject Using an extension
Extension MarkdownPlugin
Version Foswiki 2.1.7
Status Asked
Related Topics
Topic revision: r1 - 02 Nov 2022, BramVanOosterhout
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy