(we are switching to a new theme, don't worry if things look different for a while!)

Site Navigation

Home
Search
All Pages
Recent Changes

Plans

Massive Wiki Roadmap
Pier2Pier
Massive Wiki Builder redesign

For Testing

wiki link test page
Mistletoe parser test page
Mistletoe & the ampersand story

Edit This Page Clicking 'Edit This Page' opens this page on GitHub. You can edit, and save changes, if you are a contributor to the repository. Close the edit page to return to this one.


Mistletoe & the ampersand story

2023-05-10:
This is a test page to verify, and, if needed, validate a fix for Massive Wiki Builder issue number 49: # Ampersand in a wiki link on the Sidebar leads to 404 on website

Let's see if this same issue shows up here on developer-massive-wiki. And it does.

Next steps: 2023-05-11: leaving the mistletoe wikilink cargo cult:

  1. in the Obsidian Markdown page a wikilink has these parts contained within double square brackets and separated by a vertical bar (|):

    • name of the wiki page
    • optional display text
  2. in the Mistletoe rendered HTML:

    • token.target == the data in an <a>,</a> tagged item; this corresponds to the optional display text (if any) in the wikilink; otherwise the page name

    • self.render_inner(token) == content of the 'href' attribute in an <a>,<a/> tagged item; this corresponds to a weblink to the wiki page, relative to the root of the wiki directory (Obsidian vault). This value is read from a wikilinks directory constructed when running Massive Wiki Builder.

  3. one way to fix this ampersand in the page name problem is to counteract the html.escape() use prevalent in the mistletoe render classes when retrieving a weblink from the wikilinks dictionary.

    • the key line of code in mistletoe_renderer/massivewiki.py is this:
 wikilink_key = html.unescape(Path(self.render_inner(token)).name)