Skip to content

[Feature] Opt-in wiki link support ([[target|label]]) via md4cFlags.wikiLinks #1114

Open

Description

@ryzencool

Is your feature request related to a problem? Please describe.

We render LLM output in a note-taking app with EnrichedMarkdownText. Notes in our app link to each other with [[Title]] / [[Title|target]] (Obsidian-style wiki links), so the model often writes them in its replies too. Right now [[Title]] is shown as plain text with brackets: it isn't tappable and doesn't reach onLinkPress.

The bundled parser already supports this. cpp/enrmrkd/enrmrkd.h defines ENRMRKD_FLAG_WIKILINKS and ENRMRKD_SPAN_WIKILINK (with a target attribute), but MD4CParser.cpp never sets the flag and the span isn't mapped to a node, so there's no way to turn it on from JS.

Describe the solution you'd like

An opt-in md4cFlags.wikiLinks flag (default false, same as underline/highlight). When it's on:

  • [[target]] and [[target|label]] render as links (label text if present, otherwise target).
  • Pressing one calls onLinkPress / onLinkLongPress with the raw target as url, so the app can resolve it (open a note, search by title, …). An alternative is a separate isWikiLink: true on the event, or a prefix such as wiki: on the url.
  • They pick up the normal link styling, and work with linkVariants / link pills / linkContextMenuItems the same way regular links do, so apps can tell them apart from web links.

Describe alternatives you've considered

  • Rewriting [[...]] to [label](scheme://target) before rendering. This works for us, but it has to run on every streaming chunk and needs to skip code spans/blocks, which the parser already handles correctly.
  • linkRecognition.text (in nightly) with a \[\[[^\]]+\]\] regex. The brackets stay in the displayed text and there's no label/target split.

Additional context

Version checked: 1.2.0-nightly-20261029-266ba6bca (the same applies to 1.1.1). Platforms: iOS and Android (web too, ideally). We're happy to test a PR.

Activity

  1. jnowakow commented on Nov 2, 2026

    @jnowakow
    Collaborator

    Hello @ryzencool! Thanks for your input in this library development!

    Your request sounds like a valuable feature for our library. We'll work on it as soon as our capacity allows us. We'll inform you when the feature will be available in the nightly version of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions