Marked 2 doesn't serve images in subdirectories whose names begin with underscore

zabouti's Avatar

zabouti

25 Jan, 2021 10:18 PM

Marked 2, nvUltra, MultimarkdownComposer can show this image.

| images/obelix.png |
| :---------: |
| ![images/obelix.png](images/obelix.png) |

But Marked 2 cannot show this one, and I cannot figure out any way to escape the underscore or do anything to make it work.

| _assets/obelix.png |
| :---------: |
| ![_assets/obelix.png](_assets/obelix.png) |

Is there a way to get Marked 2 to read the file in _assets?

  1. 1 Posted by zabouti on 26 Jan, 2021 12:40 AM

    zabouti's Avatar

    This is driving me crazy. I just discovered that this works!

    | CJ-Suitt-activist.jpg |
    | :---------: |
    | <img src="_assets/CJ-Suitt-activist.jpg" alt="CJ" width="500px"/> |
    
  2. Support Staff 2 Posted by Brett on 26 Jan, 2021 01:53 AM

    Brett's Avatar

    if you take the underscore out of the first square brackets (but not out of the actual file path), does it work?

    - Brett

  3. 3 Posted by zabouti on 26 Jan, 2021 02:04 AM

    zabouti's Avatar

    Yes, you sneaky guy! Thank you!

  4. zabouti closed this discussion on 26 Jan, 2021 02:04 AM.

  5. Brett re-opened this discussion on 26 Jan, 2021 02:47 PM

  6. Support Staff 4 Posted by Brett on 26 Jan, 2021 02:47 PM

    Brett's Avatar

    It's because the processor is seeing the two underscores and assuming
    that it's an italics string, thereby breaking everything in between.
    It's an issue with the renderer, not necessarily with Marked. Which
    processor are you using again?

  7. 5 Posted by zabouti on 26 Jan, 2021 10:48 PM

    zabouti's Avatar

    Version 2.6.2 (1010) - The MultiMarkdown Processor is selected.

  8. Support Staff 6 Posted by Brett on 27 Jan, 2021 03:08 PM

    Brett's Avatar

    I did some testing. The Discount (GFM) processor handles it much better.
    But for MultiMarkdown, you can escape it like this:

    ```
    | _assets/obelix.png |
    | :---------: |
    | ![\_assets/obelix.png](_assets/obelix.png) |
    ```

    And it should work fine.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac