Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML in Markdown is not allowed (especially the style attribute on elements) #508

Closed
ErtugrulSener opened this issue May 23, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ErtugrulSener
Copy link

Describe the bug
HTML inside of Markdown Files needs to be rewritten in a way, that the JSX parser (as all html tags are in MDX) accepts it.
But if we do that, Obsidian is not able to display the html accordingly.

To Reproduce
Steps to reproduce the behavior:

  1. Create a file named "test.md"
  2. Add the following text to the file
<span style="font-size: 11pt">test test</span>
  1. Try compiling it by doing "npm run export" inside of the ".flowershow" folder
  2. You will get an error, that this html code inside of the markdown file is not valid

Expected behavior
Flowershow should be able to parse html as is, so that we can use it (as Obsidian also allows it)

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Brave
  • Version 113.0.5672.126

Additional context
@olayway told me to create this issue, ask her for any more information if needed

@ErtugrulSener ErtugrulSener added the bug Something isn't working label May 23, 2023
@rufuspollock
Copy link
Member

@ErtugrulSener this is a mdx issue. We are processing markdown files as mdx so you have to do:

style={{fontColor: "11pt"}}

See https://www.w3schools.com/react/react_css.asp for more.

This is annoying - but no way round it if we want MDX type support for rich JSX components. (Note to us: we should flag this in docs somewhere better!)

@ErtugrulSener
Copy link
Author

@rufuspollock Why do you need the MDX type support?
Because this makes it harder for developers to use flowershow, since there are some limitations (We need to escape "<" as well as ">", different html syntax etc.)

And I heard you are working on an obsidian extension for flowershow, how will you handle this type of things there?
Is there maybe an html to MDX converter you could use, so that the user doesn't have to deal with it?

@rufuspollock
Copy link
Member

@ErtugrulSener we support MDX so we can add charts and other rich components to markdown. However, i take your point about the complexity.

We'll think more about this - one option is to use different extensions for explicit mdx files vs markdown.

rufuspollock added a commit to life-itself/community that referenced this issue Oct 19, 2023
… (it is mdx).


Getting uninformative error: "Application error: a client-side exception has occurred (see the browser console for more information)."

Suspect this is the fact we are using html style tag rather than react style - see datopian/flowershow#508 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants