Extension talk:WikiMarkdown

About this board

How to use if you can't run composer?

3
MrStonedOne (talkcontribs)

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.

Cavila (talkcontribs)

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.

MrStonedOne (talkcontribs)

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!

Reply to "How to use if you can't run composer?"
195.77.243.20 (talkcontribs)

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';

Kuenzign (talkcontribs)

What version of SyntaxHighlight do you have installed?

195.77.243.20 (talkcontribs)

SyntaxHighlight_GeSHi: REL1_40

2023-09-28T07:23:27

d0cf937

@Kuenzign

Kuenzign (talkcontribs)

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 );
Reply to "SyntaxHighlight error"
Dakster86 (talkcontribs)

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?

Kuenzign (talkcontribs)

No, there is not currently a way to do internal links as the linking is handled by Parsedown.

Dakster86 (talkcontribs)

Got it; thanks for getting back to me!

Reply to "Internal Links?"
2001:250:1001:A008:0:0:2:1BB3 (talkcontribs)

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!

Kuenzign (talkcontribs)

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.

Reply to "Inserting images"
76.209.246.53 (talkcontribs)

that's all

Kuenzign (talkcontribs)

You just download the git repo, which is linked on the extension page

77.29.214.65 (talkcontribs)

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.

Kuenzign (talkcontribs)

How so? The download link takes you to the GitHub repo where you can download the repo.

Kuenzign (talkcontribs)

Actually, I figured out which link you were talking about. I have since replaced that link with a link to the GitHub repo.

Reply to "download link broken"
Simonsarazin (talkcontribs)

Hi,

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

Simonsarazin (talkcontribs)

I'm on mediawiki 1.35. thanks.

Kuenzign (talkcontribs)
185.165.35.88 (talkcontribs)

Perfect, it was that. Thanks a lot !

Reply to "bug on installation"

Change tag for backwards compatibility

2
201.234.7.66 (talkcontribs)

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.

Kuenzign (talkcontribs)

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.

Reply to "Change tag for backwards compatibility"
198.91.106.66 (talkcontribs)

Hi, I'm getting the following warnings when saving a page with markdown blocks.


Warning: Undefined array key "text" in E:\xampp\htdocs\wiki\vendor\erusev\parsedown-extra\ParsedownExtra.php on line 213

Warning: Undefined array key "lists" in E:\xampp\htdocs\wiki\extensions\WikiMarkdown\includes\WikiMarkdown.php on line 109

Warning: Trying to access array offset on value of type null in E:\xampp\htdocs\wiki\extensions\WikiMarkdown\includes\WikiMarkdown.php on line 109

Deprecated: Use of Parser::enableOOUI was deprecated in MediaWiki 1.35. [Called from WikiMarkdown::parserHook in E:\xampp\htdocs\wiki\extensions\WikiMarkdown\includes\WikiMarkdown.php at line 110] in E:\xampp\htdocs\wiki\includes\debug\MWDebug.php on line 377

Kuenzign (talkcontribs)

Looks like you have the $wgAllowMarkdownExtended configuration option turned on, but you don't have ParsedownExtended installed. Either install ParsedownExtended using the instructions from Install Dependencies, or remove the $wgAllowMarkdownExtended line from your LocalSettings.php.

Reply to "Warnings when saving"
There are no older topics