swilgosz/hanamimastery

Allow for special markdown tags in the data files.

swilgosz opened this issue · 0 comments

Overview

I want to have special tags in the markdown files that should be cleaned out in the rendered HTML.

Todo

  • Wiki links

[[...]] - If there is a pair of doubled square brackets in the content, and it is not inside of the code block, remove the brackets.

Examples

  • my paragraph and [[something inside]] it => <p>my paragraph and something inside it</p>

  • [[Can contain. Even multiple sentences]] => <p>Can contain. Event multiple Sentences</p

  • ## This [[header is also wrapped]] - > <h2>This header is also wrapped</h2>

  • **Block references

^... - Each block of text (paragraph, header, link, code, etc can be marked with the caret character, following the reference identifier. It will be placed at the end of the line always. as long as the reference is at the end of the mdx component content, remove everything after the ^ character.

APPLY only for text outside of code blocks

Examples:

  • # My awesome header^flk2j3j => <h1>My awesome header</h1>
  • > Important quote^kaop2n$2 => `Imprtant quote
  • Paragraph example^2324234 => <p>Paragraph example</p>

Solution

During the MDX component parsing, check each piece of content to contain any of the special tags and get rid of them.