jackyzha0 / quartz

🌱 a fast, batteries-included static-site generator that transforms Markdown content into fully functional websites
https://quartz.jzhao.xyz
MIT License
6.98k stars 2.48k forks source link

wikilinks to headings starting with links break callouts #1536

Open tinygwen opened 21 hours ago

tinygwen commented 21 hours ago

Describe the bug wikilinks to headings starting with external links break callouts

To Reproduce create a headings with an external link, ex # [wikipedia](https://wikipedia.org) create a callout with a wikilink to that section (headings) this breaks titles and bodies of both parent and nested callouts

I've created an example markdown document for this issue which demonstrates the bug.

here is the raw content of both title and body of both parent and nested callouts which can be pasted into an .md as demonstration:

>[!bug]- Test text [[wikilinks to headings starting with links break callouts#[headings that's an external link ( 3)](https //www.wikipedia.org/)|wikilink]]
>Test text [[wikilinks to heading starting with links break callouts#[headings that's an external link ( 3)](https //www.wikipedia.org/)|wikilink]]
>> [!bug]- Test text [[wikilinks to heading starting with links break callouts#[Heading that's an external link ( 3)](https //www.wikipedia.org/)|wikilink]]
>> Test text [[wikilinks to headings starting with links break callouts#[Heading that's an external link ( 3)](https //www.wikipedia.org/)|wikilink]]

# [Heading that's an external link (#3)](https://www.wikipedia.org/)
~~to wikipedia as an example, for issue 3~~
i decided to seperate into multiple bug reports but i'm leaving this title here, as i imagine the hash could also be problematic

Expected behavior callouts ought to be able to handle wikilinking to a section/heading that contains/begins with a an external link

Screenshots and Source Expected behavior, as handled in obsidian:

You can help speed up fixing the problem by either

  1. providing a simple reproduction
  2. linking to your Quartz repository where the problem can be observed I've created an example markdown document for this issue which demonstrates the bug.

Desktop (please complete the following information):

Additional context i have not tested if the heading being a wikilink also breaks the callout. i have left the # in the heading as well

saberzero1 commented 12 hours ago

I'm not sure if I'm more impressed that you found this, or that the Obsidian devs accounted for this.