Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw Markdown in rendered code blocks is detected by forgot-to-render check #128

Closed
mjs opened this issue Oct 17, 2013 · 5 comments
Closed
Labels
Milestone

Comments

@mjs
Copy link

mjs commented Oct 17, 2013

Firstly, this extension is life-changing. Thank you.

I've seen a number of cases where the forgot-to-render check is claiming rendering hasn't been done when it has, or prompting when I haven't used Markdown but it thinks I have.

I haven't been able to construct simple cases to show the problem that I can actually share (it always seems to happen with emails my employer wouldn't be happy with me posting here).

Please let me know what you need to help debug this.

@adam-p
Copy link
Owner

adam-p commented Oct 17, 2013

There are some known false-positives in #117 -- links and headers. (Fixed in the next release, which I should probably put out soon.) Those could be what you're hitting.

You can find out what's causing the Markdown detection by looking at the Thunderbird error console (Tools menu, Error Console). When the "did you forget?" box appears, there should be output in the error console that looks something like this:

Markdown Here detected unrendered emphasis: "**adsf**"

It will tell you what type of thing is detected, and where(ish).

(Note that for headers, it's actually the automatic anchor link that's created that's the problem, so the output will say "unrendered link".)

@mjs
Copy link
Author

mjs commented Oct 17, 2013

Thanks for the tip about using the error console. I'll check there next time I see this happen and will report here if I see false positives with the next version.

@mjs
Copy link
Author

mjs commented Oct 17, 2013

Ok... I have a minimal example that triggers the problem. Looks like the trigger is Markdown looking things in literal blocks. I'm not sure if this has already been fixed in trunk.

To reproduce:

  • Create a blank email
  • Enter this as the body:
    ```
    =====
     Foo
    =====

    ```
  • Hit Ctrl-Alt-M or click the convert button
  • Email converts as expected.
  • Hit send and get the "forgot to convert" warning.

Also, I see nothing in Error Console (yes, the "All" filter is selected).

@adam-p
Copy link
Owner

adam-p commented Oct 18, 2013

Thanks for the example. (I'm confused about why you didn't see Error Console output. It should have been "unrendered header". It was for me.)

The problem that your example is encountering (which I knew about and totally failed to record anywhere) is that Markdown in (rendered) code blocks is still detected as unrendered. Underlining a word with = renders to <h1>. I have changed the title of this issue.

Except... it's actually a little more complicated than that in this case. Feel free to stop reading here.

I just pushed (ee315ef) an improved unrendered-header change that will fix your specific example. MDH's HTML-to-text logic makes text in <pre> elements all one line (because there are no <br> or <p> elements in them). So the plaintext of your example is something like ===== Foo =====... which is not a valid MD header.

So, in the next release, your exact example won't be detected as unrendered me MD. But a code block with a MD link (say) in it would be.

adam-p added a commit that referenced this issue Oct 18, 2013
…t-to-render check.

<code> elements are now excluded from check.
@adam-p
Copy link
Owner

adam-p commented Oct 18, 2013

When I wrote the last comment I wasn't going to try to fix the problem in short order, but... then I realized maybe it wasn't hard.

Fixed in 8a6a32f. Will be in next release.

@adam-p adam-p closed this as completed Oct 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants