I’ve been playing with this plugin, and it’s very powerful and in many ways, exactly what I want out of a markdown plugin. Thank you!
I have one question (possibly complaint) and one bug report.
The bug I found is that the mermaid option isn’t currently working due to the fact that the pre
tag has a child code
tag, and that seems to be throwing mermaid.js off.
If I add my hack to remove the code
tag (and put the language-mermaid
class on the pre
tag, it starts working (though there are some JS errors, more on that in a bit): https://a.supportally.com/i/iYih58
Here is my hack to remove the code tag, so you can see for yourself:
add_filter( 'the_content', function( $content ) {
while ( preg_match( '/<pre><code class="language-mermaid">/', $content ) ) {
$location = strpos( $content, '<pre><code class="language-mermaid">' );
$end = strpos( $content, '</code></pre>', $location );
$code = substr( $content, $location, $end - $location + strlen( '</code></pre>' ) );
$code = str_replace( '<pre><code class="language-mermaid">', '<pre class="language-mermaid">', $code );
$code = str_replace( '</code></pre>', '</pre>', $code );
$content = substr_replace( $content, $code, $location, $end - $location + strlen( '</code></pre>' ) );
}
return $content;
}, 10, 1 );
Adding that to my theme functions file makes the charts render correctly. The JS error is related the Clipboard JS functionality in front_print_footer_scripts
— it’s expecting the pre
->code
structure, so with my hack code above, the following error happens in the console, jQuery.Deferred exception: codeClass.indexOf is not a function TypeError: codeClass.indexOf is not a function
: https://a.supportally.com/i/yaBAPj
That’s pretty easy to fix. I changed var codeClass = pre[i].children[0].className;
to var codeClass = pre[i].className === "mermaid" ? "language-mermaid" : pre[i].children[0].className;
and it cleared up — I wonder if you could make it easier for devs to hook and modify that code… Right now, if I want to keep my hack to make this work, I also need a hack with output buffer to modify that one line of JS that’s hard-coded.
I don’t think my solution with the hack is great — it would be better to fix it at the source, but once I dove into Parsedown
, I gave up.
As for the question/complaint — when I activate the plugin, instantly all posts/pages have this markdown editor on by default, despite the post-types being unselected (in the plugin settings) out of the box. My question was how to fix this so it’s off by default, but I just tested a theory by turning them on, saving the settings, then disabling them and saving, and now it seems to have the right default.
]]>Hi Terry
Both your plugins – WP Mermaid and WP Githuber MD – conflict with the Post Grid Gutenberg Blocks and WordPress Blog Plugin – PostX plugin, regular and premium. When I want to customise a template it takes me to the Classic editor page instead of the block editor. I deactivated the classic editor plugin and that didn’t change anything. I tried a second site and after activating your plugin, the same behaviour happened.
]]>I am trying to write KaTex using WPGatsbyThemes, a now discontinued headless WordPress system. I am using the latest version of WP Githubber MD 1.16.3. I also installed KaTex using yarn. As the webpage shows, I am failing to render.
$$
E=mc^{2}
$$
$$E=mc^{2}$$
Would you have any tips how to get KaTex working in Gatsby/React?
]]>Hi,
having the option “show line number in code area” toggled in the settings, we do find the line numbers output for most of the used languages. If the language of the code is set to language-html though, no line-numbers are output / displayed.
In the CSS both have the class line-numbers. Only thing that is different is the order of the classes, but which should make no differences, should it?
e.g. bash
<pre class="line-numbers language-bash " tabindex="0">
<code class="language-bash"> Here is the code
</code>
</pre>
–> OK: Line numbers are displayed
e.g. HTML
<pre class="language-html line-numbers" tabindex="0">
<code class="language-html"> Here is the code
</code>
</pre>
–> OK: Line numbers not displayed
Is this a known issue?
]]>Wonder if anyone’s encountered this before. It happens with a couple of different Markdown plugins, which when active seem to scuttle the editor in Code Snippets entirely.
Anyone run into this have figure out any kind of workaround?
Thanks.
]]>Hello,
I’m looking to import a few 100 files from a github repo of mine onto my website, and was wondering if there is a tool or scrip that could automate that?
And if there isn’t if you could add such functionality?
The absolute minimum would be a function call with a security key that takes the page name and markdown content end enters/updates it in the DB. The reading of files I can do in C myself.
Cheers
David
Looks really interesting.
1. So does this store posts in the database as Markdown?
2. What about existing posts from before install (ie. HTML-formatted)? Will they just continue to work?
3. What if you remove this plugin after authoring posts in Markdown? Would WordPress just show a post with the Markdown formatting codes, rather than a formatted post?
]]>The “HTML to Markdown” function is very handy. Unfortunately, when you click on “Convert”, all blank lines (= paragraphs) are removed. The option “Line Break: yes/no” has no influence on this.
]]>Hi,
Using Gutenberg / WP 5.8.2 with Markdown as the default for posts, users can’t switch from Markdown to Gutenberg until they save a new post as a draft. The switcher only appears after saving. Could you help me with that?
]]>Hello, is there a reason why the edition field is not recognized as a text field by browsers?? It breaks some useful browsers plugins features (spelling by example).
]]>Should this plugin be rendering footnotes?
While I don’t see any mention of extended MD footnotes in the features list, I see it mentioned in the Github fixes. But footnotes are not being rendered on my site on the frontend (the rest of the markdown is being rendered as expected).
Someone has asked this here before, but it didn’t receive any responses. But I’m running into the same issue.
Using plugin v.1.16.0 on WP 5.8.1.
]]>Expressions like {{xy}} do render correctly in the preview mode on the backend, but not on the frontend. Here the whole expression is missing.
A “workaround” of having a space between the curly brackets would work, but then the space between the parentheses does get rendered on the frontend too.
Is there any aproach to prevent the {{xy}} within <code>
or <pre>
to be executed?
Running WP 5.7.1 I am not able to get this plugin to work properly. I see it is installed, it shows the convert window on the top right section of my posts, and I have markdown enabled via Jetpack yet I do not see the side by side panel that should show as you write your article.
Has anyone else experienced this?
]]>Maybe I’m doing something wrong, but the editor doesn’t have a monospaced typeface. It only has the variable spaced font. I’ve checked the settings, but I can’t find anything to change it. Any help would be appreciated.
]]>Hi,
I’s need the possibility to specify some defaut settings for my multisite wordpress (100 sites).
I tried to change in /src/controllers/settings/php but it does not work.
I’d like that md could be off by defaut and could be pass to on by users.
A global setting for all sites could be cool !
Any hint ?
Edit : I did not see any switcher between regular editor and markdown though
]]>I can’t get it to work.
]]>After installing I checked the module to provide a contents table. I then edited existing posts to disable the MD functionality however a contents table is still generated for posts on which the MD functionality is disabled.
For now I have disabled the contents table module but it is a feature it will be good to use – but only on posts that use MD
]]>Hi, i need to add a link markdown in woocommerce custom attribute, it seems do not working. Please help me
]]>I want to import many MD files from Notion. How can I do that with the plugin?
]]>I have posts written in markdown. When I hit the update button, they’re converted to HTML, so that the next time I go to edit it, I’m presented with an HTML version. I’d like them to stay as markdown for all editing, which is the standard behavior I’ve had with the Jetpack markdown module.
I don’t have any other markdown plugins activated (I had Jetpack’s markdown enabled, but it looks like this plugin disables it automatically).
I have:
– Enable Markdown option enabled for the post.
– HTML-to-Markdown disabled in settings
– HTML Decode is enabled in settings
– Markdown Extra is enabled in settings
Is there some setting I’m missing that controls this behavior?
EDIT: I’ve since found an issue report for this behavior in the Github tracker. It sounds like the same issue I’m having.
]]>I’m using Toolset’s Forms (https://toolset.com/home/cred/) to let users submit and edit custom posts. Is there any way to use this markdown support on the front end for custom post types?
]]>Thank you for your plugin developing. This is good plugin and help me to save a lot of time.
During using the plugin, i have a problem. When i typed double quote such as awk -F: "{ print $1}" /etc/passwd
on my post, and then i preview first. The double quote was changed to awk -F: '{ print $1}' /etc/passwd
.
You can see detail here: https://toilamit.com/2019/12/10/hien-thi-danh-sach-users-trong-linux/
Please preview and check, if possible, please update this issue. Thank you so much
]]>I see a few people have looked for this feature – do you plan on integrating Markdown into the default WordPress comments form?
I’d rather use what’s available in this plugin already, instead of adding another third-party solution. Thanks.
and if it could work with the “Lazy Load for Comments” plugin that would be great!
]]>Hi all,
Cudo’s on the plugin, awesome piece of functionality! … I’d like to maintain my, somewhat tech documentation, fully in markdown, but want the end result in the post that visitors see on my website always in HTML. Is that possible?
Thanks and good luck!
Gerard.
]]>So I didn’t know auto-saving was disabled by default. Just lost a thousand words of content because of that.
Another thing – when the plugin is on, WordPress doesn’t warn anymore that content is unsaved. So you can literally hit any link in the WP dashboard to lose what you’re writing.
Also I turned the auto-saving feature back on and it isn’t saving anything. I don’t see any changes or any new revisions after a few minutes.
]]>First thanks for this great plugin.
I have a question, I don’t know if it is a feature request or a bug report, but if I throw a pdf file instead an image to the edit zone , the media library is been opened, the file is uploaded ok but after pressing “insert in the entry”, no link is created referencing that file on the markdown editor as I would spect.
I’d have no problem creating the entry by myself, but I have a group of “low computer knowledge editors” who would be very happy if that procedure worked that way.
Thanks.
]]>I’ve checked the box “Enable Markdown for comments.” but the comment textarea is still plain.
]]>Hello! Thanks for the great plugin. Tell me, please, why is this not working?
<div style="text-align: center;">

</div>
The text becomes centered, but Markdown is not executed and remains simply text.
Thanks!
]]>很謝謝你在 1.6 的更新,現在我能依據不同的 post type 去使用 WP Githuber MD 了。
我有個使用需求,不知道你能不能指點一下:
我最近在處理 makecode 的教學文件,像是
https://minecraft.makecode.com/reference/player/on-chat-command
不過我發現微軟有特製的 md 語法,官方的說明文件如下
https://makecode.com/writing-docs/macros
希望像這種額外的 md 語法,未來能不能經由你的插件來擴充。
]]>1. When the plugin is enabled, the editor in other post type will auto become text mode, and can’t switch to visual mode anymore. I think it is a bug.
2. I suggest that there is a option to check to enable the function, therefore we can decide where to use it. For me instance, I use Page Builder to design Page, and use Guternburg to write post, and I have a custom post type plugin to manager my document, and I hope to use this GREAT plugin.
Last, thanks for your contribution. The plugin is AWESOME.
]]>