Giter Site home page Giter Site logo

mw-markdown's People

Contributors

arthaey avatar bharley avatar karlwilbur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mw-markdown's Issues

How does internal link syntax work for this? Does it play well with the visual editor?

Normal wiki text internal links are like this

[[name of page]]

And they either create a new page or link automatically to the page, while markdown links look like this:

[text in the link](url goes here)

If this plugin allows the parser to use markdown, then how does it handle internal links? Do you have to write out the url for the page etc?

Call to undefined method Parser::doDoubleUnderscore

Hello

Since the update to MW 1.35, I have this error :

[7f97b81e8eee35691a6d95e4] /index.php?title=Impression_3D Error from line 110 of /stockage/www/wiki/extensions/Markdown/Markdown.php: Call to undefined method Parser::doDoubleUnderscore()

(full log at the end of this message).

I also reproduced it with the mediawiki Docker. I use MW 1.35, fresh install with only Markdown extension. When disabling this extension, MW works fine.

[7f97b81e8eee35691a6d95e4] /index.php?title=Impression_3D Error from line 110 of /stockage/www/wiki/extensions/Markdown/Markdown.php: Call to undefined method Parser::doDoubleUnderscore()

Backtrace:

#0 /stockage/www/wiki/extensions/Markdown/Markdown.php(85): MarkdownExtension::parseMarkdown(Parser, string)
#1 /stockage/www/wiki/includes/HookContainer/HookContainer.php(320): MarkdownExtension::onParserBeforeInternalParse(Parser, string, StripState)
#2 /stockage/www/wiki/includes/HookContainer/HookContainer.php(131): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#3 /stockage/www/wiki/includes/HookContainer/HookRunner.php(2901): MediaWiki\HookContainer\HookContainer->run(string, array)
#4 /stockage/www/wiki/includes/parser/Parser.php(1539): MediaWiki\HookContainer\HookRunner->onParserBeforeInternalParse(Parser, string, StripState)
#5 /stockage/www/wiki/includes/parser/Parser.php(651): Parser->internalParse(string)
#6 /stockage/www/wiki/includes/content/WikitextContent.php(374): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#7 /stockage/www/wiki/includes/content/AbstractContent.php(590): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#8 /stockage/www/wiki/includes/Revision/RenderedRevision.php(263): AbstractContent->getParserOutput(Title, integer, ParserOptions, boolean)
#9 /stockage/www/wiki/includes/Revision/RenderedRevision.php(235): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#10 /stockage/www/wiki/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#11 /stockage/www/wiki/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#12 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#13 /stockage/www/wiki/includes/Revision/RenderedRevision.php(197): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#14 /stockage/www/wiki/includes/poolcounter/PoolWorkArticleView.php(216): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#15 /stockage/www/wiki/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleView->doWork()
#16 /stockage/www/wiki/includes/page/Article.php(810): PoolCounterWork->execute()
#17 /stockage/www/wiki/includes/actions/ViewAction.php(74): Article->view()
#18 /stockage/www/wiki/includes/MediaWiki.php(527): ViewAction->show()
#19 /stockage/www/wiki/includes/MediaWiki.php(313): MediaWiki->performAction(Article, Title)
#20 /stockage/www/wiki/includes/MediaWiki.php(940): MediaWiki->performRequest()
#21 /stockage/www/wiki/includes/MediaWiki.php(543): MediaWiki->main()
#22 /stockage/www/wiki/index.php(53): MediaWiki->run()
#23 /stockage/www/wiki/index.php(46): wfIndexMain()
#24 {main}

Tags

<pre>, <math> don't seem to work.

Handle Edit Toolbar

The edit toolbar always inserts wiki markup, and this isn't very useful if Markdown is the primary article syntax being used.

Either add an option to remove the toolbar or modify it so that it can handle Markdown syntax.

Table rendering problem

After I installed it correctly, I found that the table rendering did not meet my expectations.
for example.How can the table show the border?Am I installing correctly?
image

ps. I want the border like
image

UNIQ QINU errors with some other extensions

For some extensions, I end up with UNIQ-QINU problems.

For example, using the Labeled Section Transclusion or Simple Calendar, the parser output looks like this:

�'"UNIQ--section-00000002-QINU"'� Labeled Section Transclusion section tag �'"UNIQ--section-00000003-QINU"'�

�'"UNIQ--item-4--QINU"'� SimpleCalendar should have appeared here

After much digging, I found what might be a solution. I changed line 116 from replaceVariables to recursivePreprocess instead. I've tested this on a few of my private wiki's pages and haven't seen a downside to using this method instead.

Per the MediaWiki source code, the recursivePreprocess calls replaceVariables itself, so it should hopefully(!) Just Work...

<nowiki> not working with link syntax

The <nowiki> tag doesn't quite function correctly with this extension active, in particular when used with the mediawiki links syntax.

An example of the problem is shown on the Special:Upload page. Instead of seeing the correct markup help, I see this:

image

When we should be seeing:

  • [[File:File.jpg]] to use the full version of the file

etc

This seems to be because Markdown.php calls $parser->replaceInternalLinks($html) without any attempt to escape things that are inside a <nowiki> tag.

Ideally I'd like to escape <nowiki> content before processing these links, but I can't find any simple function to call in the parser to make this happen 😞

I'd love to help fix this up if anyone has any ideas about where to start.

Unable to use markdown extension.

I try to integrate Markdown extension with MediaWiki but it does not work.

I have MediaWiki 1.35.2 and php 7.4.3.

When I use {{MARKDOWN}} in page I see this error:
"mediawiki/extensions/Markdown/Markdown.php: Call to undefined method Parser::doDoubleUnderscore()"

Extension is unable to find WikiMedia parser so all available functions on parser become undefined.

MWException on page load

After installing and requiring the plugin, I got an MWException. This is the exception message:
Original exception: exception 'MWException' with message 'Detected bug in an extension! Hook MarkdownExtension::onBeforePageDisplay failed to return a value; should return true to continue hook processing or false to abort.' in /srv/http/mediawiki/includes/Hooks.php:284

I'm using mediawiki-1.21.2

Markup produced by Cite extension contains a lot of extra <p> tags

With Markdown rendering active I get this:

image

instead of this:

image

The markup in the first example (Markdown active) looks like this:

<p>The Sun is pretty big.</p><p><sup id="cite_ref-1" class="reference"><a href="#cite_note-1">&#91;1&#93;</a></sup></p><p> The Moon, however, is not so big.</p><p><sup id="cite_ref-2" class="reference"><a href="#cite_note-2">&#91;2&#93;</a></sup></p><p class="mw-empty-elt"></p>

but the markup should look like this:

The Sun is pretty big.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2">&#91;1&#93;</a></sup> The Moon, however, is not so big.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3">&#91;2&#93;</a></sup>

Literal {{WIKI}} text via templates

When I include {{WIKI}} in a template, it renders correctly on the template page itself, but it literally says "{{WIKI}}" on any pages that include the template.

Auto-detect markdown

Using this on a mediawiki can cause problems because of both legacy content and the Special:: pages. However, it should be possible to analyze the content of a page and determien if it is in mediawiki markup or in markdown by counting the number of headlines that match each headline format. Then it would be possible to dispense with the {{WIKI}} tag.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.