WordPress.org

Making WordPress.org

Opened 2 years ago

Closed 18 months ago

#2655 closed defect (maybelater)

Code blocks escaped with backticks are not parsed in FAQ?

Reported by: GamerZ Owned by:
Milestone: Priority: normal
Component: Plugin Directory Keywords:
Cc:

Description

I am not sure whether it is my mistake.

But I have a few code blocks which are escaped by backticks as a FAQ. You can take a look at the readme.txt in SVN https://plugins.trac.wordpress.org/browser/wp-polls/trunk/readme.txt (right at the end)

But when it is parsed https://wordpress.org/plugins/wp-polls/ (expand the "To Display Total Polls"), only the bullet point is being parsed.

Is it a bug or my mistake?

Change History (8)

#1 @SergeyBiryukov
2 years ago

  • Component changed from General to Plugin Directory

#2 @dd32
2 years ago

Looks like the Markdown parser is getting confused a bit here - but also that it's being more strict than the previous one.

Although it previously worked, code blocks are not supposed to be surrounded by a single backtick, instead according to the Markdown syntax they're supposed to be indented (ie. see how github parses that readme)

We're using Markdown Extra which adds extra syntaxes, such as fenced code blocks which should help here.

There might be something else happening here though, because even after changing it to a fenced code block, it still choked returning the following, note the unescaped <?php.

<pre><code><?php if ( function_exists( 'get_pollanswers' ) ): ?>
&lt;?php get_pollanswers(); ?&gt;
<?php endif; ?>
</code></pre>

I'm not sure if this is being caused by the fact it's within a list element, or if the library simply can't process code blocks properly.

#3 @GamerZ
2 years ago

@dd32 does it now supports markdown better?

I have a parser to convert GitHub README.md to WordPress readme.txt. This is the original README.md https://github.com/lesterchan/wp-polls/blob/master/README.md

Will it work if I just use this readme and paste it over to WordPress readme.txt since it is better supported?

#4 @figureone
2 years ago

#2770 was marked as a duplicate.

#5 follow-up: @Otto42
2 years ago

@GamerZ Can't hurt to try the original form. I have seen authors using more or less unaltered markdown, including such things as # headers. Seems to work fine in the new directory.

#6 in reply to: ↑ 5 @GamerZ
2 years ago

Replying to Otto42:

@GamerZ Can't hurt to try the original form. I have seen authors using more or less unaltered markdown, including such things as # headers. Seems to work fine in the new directory.

Thanks. I tested, it works fine. But the bug still persists despite using GH Markdown. Can't have code in a bullet point

This ticket was mentioned in Slack in #meta by ipstenu. View the logs.


22 months ago

#8 @tellyworth
18 months ago

  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.