Closed malberts closed 8 months ago
Additionally, even non-Markdown URLs get rendered as Markdown.
Example with the same config as above:
{{#embed:https://github.com/ProfessionalWiki/ExternalContent/blob/master/src/Adapters/EmbedPresenter/UsageTracker.php}}
{{#embed:https://github.com/ProfessionalWiki/ExternalContent/blob/master/src/Adapters/EmbedPresenter/UsageTracker.php|lang=php}}
For my clarity, please clarify:
From what I understood from https://github.com/ProfessionalWiki/ExternalContent/issues/37
If $wgExternalContentRenderMarkdownByDefault === true
then all files will be rendered as Markdown by default
If $wgExternalContentRenderMarkdownByDefault === false
then all files will be rendered as Code by default, unless render
parameter is defined
Now, what I've missed is if the lang
parameter is defined, it should render as code regardless.
Am I correct?
If $wgExternalContentRenderMarkdownByDefault === true then all files will be rendered as Markdown by default
Only if it is a Markdown file. It doesn't make sense to render non-Markdown files. The intention with this config is to maintain backward compatibility with version 1.x where only Markdown was originally supported and therefore it was the default.
If $wgExternalContentRenderMarkdownByDefault === false then all files will be rendered as Code by default, unless render parameter is defined
Yes.
Now, what I've missed is if the lang parameter is defined, it should render as code regardless.
Yes.
Follow-up to #53 and #42
In LocalSettings, set:
$wgExternalContentRenderMarkdownByDefault = true;
(or remove the line to use the default true).Use this wikitext in a page:
{{#embed:https://github.com/ProfessionalWiki/ExternalContent|lang=md}}
The Markdown is now rendered, but it should be in a code block:![Screenshot_20231030_134331](https://github.com/ProfessionalWiki/ExternalContent/assets/1428594/5dffd7a9-ad4c-4402-86c6-32f843ea739c)