#2336 closed defect (bug) (fixed)
Markdown Parser for FAQ mis-parsing headers and code
Reported by: | Ipstenu | Owned by: | dd32 |
---|---|---|---|
Milestone: | Plugin Directory v3.0 | Priority: | normal |
Component: | Plugin Directory | Keywords: | needs-patch has-screenshots |
Cc: |
Description
On https://wordpress.org/plugins-wp/wp-force-login/ under the FAQ item "2. How can I add exceptions for certain pages or posts?" has two 'sub FAQs' for Bypass Force Login and Whitelist URLs.
Both of those are using markdown BOLD, not headers, and should not be headers.
If you go from a header directly to code, without any normal text in between, it fails to mark the code as well, code.
Attachments (2)
Change History (10)
#1
@
8 years ago
For reference as to why this happens, it's because many people use bold as question, and non-bold as answer.
What we could do here is detect if headings are present and if so, parse out the Q/A based on that, else, fall back to Bold Q/A
#2
follow-up:
↓ 3
@
8 years ago
I don't see a problem with not supporting the bold for questions, though. I mean, if we tell people "Use headers properly" then it's less for us :)
#3
in reply to:
↑ 2
@
8 years ago
Replying to Ipstenu:
I don't see a problem with not supporting the bold for questions, though. I mean, if we tell people "Use headers properly" then it's less for us :)
I can't easily query for it, but a significant amount use bold (and no headings), much fewer have questions like the example used here - I'd be just as happy telling people not to use bold sub-headings in Q&A :)
Matching either/or is easy though, we just do it based on which type of section is encountered first.
The code responsible here only parses the Update Notice
and FAQ
sections, so changing it affects little.
#4
@
8 years ago
@dd32 makes a good point – we could just as easily not use bold sub-headings in Q&A, but it would be nice if we could.
I'm less concerned about the bold versus heading format as I am about the code example not parsing.
Thanks!
#5
@
8 years ago
Why do you have to be reasonable, @dd32 ?
Okay so if more people use bold for FAQ headers, leave that alone and figure out why the code example doesn't parse if it's the first line after a header?
#6
@
8 years ago
- Owner set to dd32
- Resolution set to fixed
- Status changed from new to closed
In 4562:
#7
@
8 years ago
I'll note that correcting the matching, has also made the code blocks be recognised correctly.
I wasn't able to find an example of bolded questions, but i recall it being very common. If someone runs into another example of FAQs being mis-parsed, open a new ticket (unless it's directly related to this and seen in the next week or so)
Example of code not parsing