If you cannot see this post, you can use this image
Your task is to create a markdown parser that outputs Unicode. It should support 𝗯𝗼𝗹𝗱, 𝘪𝘵𝘢𝘭𝘪𝘤, 𝙼𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎, and 𝗎̲𝗇̲𝖽̲𝖾̲𝗋̲𝗅̲𝗂̲𝗇̲𝖾̲.
Every alphabetical character should be converted into Math Sans. This includes the characters before an underline character.
Underlines: Add a
̲ character (code point 818) after each character. Underlines can be combined with anything else.
There should be no way to escape a control character.
The following combinations should be supported:
𝖠𝖡𝖢𝖣𝖤𝖥𝖦𝖧𝖨𝖩𝖪𝖫𝖬𝖭𝖮𝖯𝖰𝖱𝖲𝖳𝖴𝖵𝖶𝖷𝖸𝖹𝖺𝖻𝖼𝖽𝖾𝖿𝗀𝗁𝗂𝗃𝗄𝗅𝗆𝗇𝗈𝗉𝗊𝗋𝗌𝗍𝗎𝗏𝗐𝗑𝗒𝗓 (code point 120224 to 120275 Math Sans)
` (120432 to 120483 Math Monospace)
* (120328 to 120379 Math Sans Italic)
** (120276 to 120327 Math Sans Bold)
*** (120380 to 120431 Math Sans Bold Italic)
__ (818 Math Sans with Combining Low Line after each character)
`__ (Math Sans Monospace with Combining Low Line)
Underline should also support Math Sans Italic, Math Sans Bold, and Math Sans Bold Italic
The final output should not contain the characters used to format the text.
Some things can be nested. Underlines can nest with any character and can be put in the inside or outside of another control character. Both of these will have an underline
**Underlines __inside the bold__** __Bold **inside the underline**__
Other things such as bold, monospace, bold italic, and italic can't nest because there are no charactes for it
**This is `not valid` input and will***never be given*
Ambiguous Formatting Characters
Formatting characters that can be ambiguous will never be given.
** is valid because it is bold, but
**** will never be given because it is undefined.
At the end of formatting characters, there will always be another character between the next formatting delimiter of the same character.
*format***ing** will not be given because there should be a character before the next
*format* **ing** delimiter using
*format*__ing__ could be given because they are different characters used in the delimiter.
**Which is bold ***and which is italic?* <-- Invalid, will never be given **Oh I see** *now.* <-- Valid
Nothing can escape. There is no way to use any of the control characters except for a singular underscore
*There is no way to put a * in the text, not even \* backslashes* <-- All of the asterisks will be italic Even __newlines don't interrupt__ formatting <-- newlines don't interrupt will all be underlined Because the singular _underscore is not a formatting character, it_is allowed_ and will not be removed
*This* is_a **test** of __the ***markdown*** `parser`__ Multi-line `__should be__ supported`. Nothing `can\` escape.
𝘛𝘩𝘪𝘴 𝗂𝗌_𝖺 𝘁𝗲𝘀𝘁 𝗈𝖿 𝗍̲𝗁̲𝖾̲ ̲𝙢̲𝙖̲𝙧̲𝙠̲𝙙̲𝙤̲𝙬̲𝙣̲ ̲𝚙̲𝚊̲𝚛̲𝚜̲𝚎̲𝚛̲ 𝖬𝗎𝗅𝗍𝗂-𝗅𝗂𝗇𝖾 𝚜̲𝚑̲𝚘̲𝚞̲𝚕̲𝚍̲ ̲𝚋̲𝚎̲ 𝚜𝚞𝚙𝚙𝚘𝚛𝚝𝚎𝚍. 𝖭𝗈𝗍𝗁𝗂𝗇𝗀 𝚌𝚊𝚗\ 𝖾𝗌𝖼𝖺𝗉𝖾.
This input is not valid and it doesn't matter what your program outputs:
*This **is not valid** input* because it nests italic and bold *Neither `is this`* because it nests italic and monospace *This***Is not valid** Either because it can be interpreted different ways
As this is code-golf, the shortest solution in bytes wins.