-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Labels
category: docsDocumentation changesDocumentation changesgood first issueSomething easy to get started withSomething easy to get started with
Description
Marked version: 2.1.3
Describe the bug
I'm using marked in my next.js app. I have this code:
const fs = require('fs');
const marked = require("marked");
var content = fs.readFileSync('/sample/markdown/file.md', 'utf8');
content = marked(content);
And this is my file.md:
# Formal sciences
***
## Tools
- [GeoGebra](https://www.geogebra.org/)
And this is my output:
But if I only add one line to the beginning of my file.md, then I get this result:
To Reproduce
Steps to reproduce the behavior:
It works on your demo playground. But it doesn't work in my next.js app. And I only call your marked method passing my file's content. Nothing more.
- Create a
next.jsapp - Add
marked - Create an
htmlfile and serve it. - Now change the extension of that
HTMLfile to.md. - First line is not respected as markdown.
If we create .md file in the first place, things work as expected. But when we change the extension of an existing HTML file to .md, first line breaks.
Expected behavior
The first line should be respected as markdown too. I can't add an empty line to all of my files.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
category: docsDocumentation changesDocumentation changesgood first issueSomething easy to get started withSomething easy to get started with

