-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
markdown-to-json refuses to work on some aspects #563
Comments
Try wrapping your content with |
Not working, I keep getting the same error, the content is showed and italics, bold... is formatted correctly, however, I keep getting titles (using #) as normal text and tables are not shown |
Gotcha. Any chance you could put together a minimal reproduction? It's hard to help without sample code. |
Yeah, sure. My markdown file looks something like this: ---
title: "Some title"
subtitle: "Some subtitle"
date: "some date"
author: "author"
---
Markdown content
### Title (just a normal markdown file) then I receive that file in /[slug].tsx in which slug is the filename. I pass that slug to a function that selects the data of the file just like this: import matter from 'gray-matter' // This is used to separate the data between --- and the content itself
import fs from 'fs'
const getPostContent = (slug: string) => {
const folder = 'src/posts/'
const file = `${folder}/${slug}.md`
const content = fs.readFileSync(file, 'utf-8')
const matterResult = matter(content)
return matterResult
} and then on my component I just pass to the const PostPage = (props: any) => {
const slug = props.params.slug
const post = getPostContent(slug)
return (
<div className='flex items-center justify-center flex-col'>
<article className='prose lg:prose-xl px-5'>
<Markdown>{post.content}</Markdown>
</article>
</div>
)
} The weird thing about it is that some weeks ago it worked absolutedly perfect and then all of a sudden it stopped formatting what I said above. Markdown code| Team | Driver 1 | Driver 2 |
| ----------------- | ---------------- | ----------------- |
| Red Bull Racing | Verstappen | **Ricciardo** |
| Ferrari | Leclerc | **Hamilton** |
| Aston Martin | **Sainz** | Stroll |
| Williams | _Kimi Antonelli_ | Albon |
| Stake Kick Sauber | Bottas | **Hulkenberg** |
| Mercedes | Russell | **Alonso** |
| McLaren | Norris | Piastri |
| Alpine | Gasly | **_??? Unknown_** |
| Visa CashApp RB | _Liam Lawson_ | Tsunoda |
| Haas | _Oliver Bearman_ | Magnussen | As you can see, bold and italics are working just fine, but the table isn't |
At least visually from that screenshot it looks like the table is intact, are you referring to missing styling or something? The content is aligned into columns as you would expect. |
I'll try to reproduce this in a sandbox, thanks for the sample code |
Hmmm, that's true. Now that I think of it, it might not be a problem of the I'll try to investigate this and let you know if this was the problem |
Turns out it was just a Tailwind problem because I accidentally removed the plugin which allowed me to use the Thanks for the help anyways. |
Ah ok, thanks for using the library :-) |
My issue is pretty self-explanatory.
I just have a piece of markdown coming from a file and I pass it through the
<Markdown></Markdown>
component and it just works... more or less.If I pass something like
_Hello World_
it converts it to italics. However, using # to specify headings won't work and neither do tables.I don't get any console warning or error, and I just can't find what's wrong
The text was updated successfully, but these errors were encountered: