- It is not working in docker, it breaks VisualEditor,User menu, notification button, etc.
- I tried running `composer install --no-dev` in its folder, got error that it needs php 7.0 which i fixed by running `composer config platform.php 7.0` then 7.2 then 7.2.9. After that it runs install command even on 8.1.29 BUT throws ' Error: Class "ParsedownExtended" not found' even though i am not using extended config
Extension talk:WikiMarkdown
If I include a Markdown with multiple levels of headers (e.g. `#`, `##`...), the headers do not appear in MediaWiki's automatically generated table of contents (only those headers defined outside the `<markdown>` tags appear).
Is it possible to also include headers inside the Markdown using this extension? There's the `toc` option in Parsdown Extended but that generates a TOC inline at the top of the page which is separate from the regular MediaWiki table of contents.
No, sadly this is not currently possible. To my knowledge, making changes to a page's ToC would require modifications to the core MediaWiki software.
When LocalSettings.php allows usage of Parsedown Extended:
wfLoadExtension( 'WikiMarkdown' );
$wgAllowMarkdownExtra = true; // allows usage of Parsedown Extra
$wgAllowMarkdownExtended = true; // allows usage of Parsedown Extended
the following error occurs:
InvalidArgumentException: Sub-setting 'single_dollar' does not exist in 'math'.
Backtrace:
from /var/www/html/vendor/benjaminhoegh/parsedown-extended/src/ParsedownExtended.php(250)
#0 /var/www/html/vendor/benjaminhoegh/parsedown-extended/src/ParsedownExtended.php(190): ParsedownExtended->initializeSettings(array)
#1 /var/www/html/extensions/WikiMarkdown/includes/WikiMarkdown.php(327): ParsedownExtended->__construct(array)
#2 /var/www/html/extensions/WikiMarkdown/includes/WikiMarkdown.php(215): WikiMarkdown::getParsedown()
#3 /var/www/html/extensions/WikiMarkdown/includes/WikiMarkdown.php(46): WikiMarkdown::parseMarkdown(string, array)
#4 /var/www/html/includes/parser/Parser.php(4019): WikiMarkdown::parserHook(string, array, Parser, PPFrame_Hash)
#5 /var/www/html/includes/parser/PPFrame_Hash.php(353): Parser->extensionSubstitution(array, PPFrame_Hash, boolean)
#6 /var/www/html/includes/parser/Parser.php(2953): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#7 /var/www/html/includes/parser/Parser.php(1609): Parser->replaceVariables(string)
#8 /var/www/html/includes/parser/Parser.php(723): Parser->internalParse(string)
#9 /var/www/html/includes/content/WikitextContentHandler.php(301): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)
#10 /var/www/html/includes/content/ContentHandler.php(1721): WikitextContentHandler->fillParserOutput(WikitextContent, MediaWiki\Content\Renderer\ContentParseParams, ParserOutput)
#11 /var/www/html/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput(WikitextContent, MediaWiki\Content\Renderer\ContentParseParams)
#12 /var/www/html/includes/EditPage.php(4535): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput(WikitextContent, Title, NULL, ParserOptions)
#13 /var/www/html/includes/EditPage.php(4438): EditPage->doPreviewParse(WikitextContent)
#14 /var/www/html/includes/EditPage.php(3144): EditPage->getPreviewText()
#15 /var/www/html/includes/EditPage.php(779): EditPage->showEditForm()
#16 /var/www/html/includes/actions/EditAction.php(73): EditPage->edit()
#17 /var/www/html/includes/actions/SubmitAction.php(38): EditAction->show()
#18 /var/www/html/includes/MediaWiki.php(542): SubmitAction->show()
#19 /var/www/html/includes/MediaWiki.php(322): MediaWiki->performAction(Article, Title)
#20 /var/www/html/includes/MediaWiki.php(904): MediaWiki->performRequest()
#21 /var/www/html/includes/MediaWiki.php(562): MediaWiki->main()
#22 /var/www/html/index.php(50): MediaWiki->run()
#23 /var/www/html/index.php(46): wfIndexMain()
#24 {main}
Setting single_dollar
to true or false doesn't fix the error
$wgParsedownExtendedParameters = [
'math' => [
'single_dollar' => true
],
'sup' => true,
'sub' => true
];
What version of Parsedown Extended are you using?
It looks like Parsedown Extended 1.2+ completely changes the configs. Please try downgrading to version 1.1.2 of Parsedown Extended.
Is there a zip with the included dependencies on the github? most extensions have releases with everything needed to run it in a .zip. in fact thats how the mediawiki releases work.
I'm afraid that Composer is used so it can install dependencies in the vendor directory and update logs, which is not always something you can do by hand. An approach you could try is to run Composer on a local copy of your MediaWiki files inside something like Docker. Some people without access to a CLI have managed to run Composer from a PHP file, but I'm not sure how practical that would be.
I was able to fork the repo and make a github action that just runs composer and compiles up a .zip as a artifact.
I was able to just add "load_composer_autoloader": true,
to the extension json and the .zip just worked no issue.
Somebody working on the repo with more time and experience with github actions than me could automate releases that do this for all supported php versions (which seems to just be 7.4 because all the other ones errored out) and then installation wouldn't require a cli at all!
I have "SyntaxHighlight" extension installed and it works fine with Wikitext, but when I edit in markdown mode like this:
```python
python code here
```
System throws this error:
[015b401c65ab6b87b21ccd91] /index.php?title=Azala Error: Class "SyntaxHighlight" not found
Backtrace:
from /home/projects/wiki/extensions/WikiMarkdown/includes/WikiMarkdown.php(102)
#0 [internal function]: WikiMarkdown::{closure}()
#1 /home/projects/wiki/extensions/WikiMarkdown/includes/WikiMarkdown.php(104): preg_replace_callback()
#2 /home/projects/wiki/includes/parser/Parser.php(3996): WikiMarkdown::parserHook()
...
my LocalSettings:
# highlight
wfLoadExtension('SyntaxHighlight');
# markdown
wfLoadExtension('WikiMarkdown');
$wgAllowMarkdownExtra = true; // allows usage of Parsedown Extra
$wgAllowMarkdownExtended = true; // allows usage of Parsedown Extended
$wgSyntaxHighlightLanguageCodeMap['markdown'] = 'markdown';
What version of SyntaxHighlight do you have installed?
SyntaxHighlight_GeSHi: REL1_40
2023-09-28T07:23:27
d0cf937
It seems that on versions of SyntaxHighlight 1.39+, they put everything in a namespace. As a workaround for the time being, you can change line 102 of WikiMarkdown/includes/WikiMarkdown.php
to be this instead:
return MediaWiki\SyntaxHighlight\SyntaxHighlight::parserHook( html_entity_decode( $matches[3] ), $args, $parser );
I can't seem to get internal (to the wiki) links to work in blocks of markdown.
If I include a mediawiki-formatted internal link, e.g., [[TestPage]]
inside of the <markdown> ... </markdown> tags, it doesn't get formatted as a link but just appears as "TestPage".
Is there a way to have internal links within the markdown blocks?
No, there is not currently a way to do internal links as the linking is handled by Parsedown.
Got it; thanks for getting back to me!
Hello,
I'm trying to insert an image using vanilla Markdown semantics:
![SomeText](://my_ip/index.php/File:some_image.png)
To avoid spam, the link header is removed.
But this does not correctly show the image.
I'm wondering how I can insert images correctly? Thanks!
You should be able to use the same url that you are able to use to display the raw image in your browser. If you go to the File page and then click on the image, it should take you to the url where the raw image is hosted at. This isn't a very nice way to do it though, so I'd recommend putting an issue on the GitHub repo to have native support for MediaWiki File pages.
that's all
You just download the git repo, which is linked on the extension page
Download link for the Wiki Markdown extension is broken. If you follow the link to download extension it takes you to a page where it says the extension does not exist.
How so? The download link takes you to the GitHub repo where you can download the repo.
Actually, I figured out which link you were talking about. I have since replaced that link with a link to the GitHub repo.
i got this problem on installation :
[8cda576ceb760c00801e4fa4] /index.php?title=Test3&action=submit Error from line 330 of /home/fuzzy/mediawiki/mediawiki-1.35/extensions/WikiMarkdown/includes/WikiMarkdown.php: Class 'Parsedown' not found
Thanks a lot if you've a solution
I'm on mediawiki 1.35. thanks.
Did you follow the instructions from Install Dependencies?
Perfect, it was that. Thanks a lot !
I'd like to know if it would be possible to change the <markdown> tag for {{MARKDOWN}} , which is what the old markdown extension used.
If you know another way to massively change the pages to be able to migrate to this extension that would also work for me.
Thanks and good job with the extension.
The older extension didn't really work the same and I don't really intend to change this extension to match as this was an intentional design choice. You could perhaps use the Extension:MassEditRegex in order to change all of your pages, but I have not used that extension so I'm not certain how well it works.