question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sourced markdown file has bad formatting

See original GitHub issue

I have a markdown file called stuff.md:


# Some markdown

Here's a markdown file to import.

> And a quote

`oh and some code`

I attempt to source it:

        <Slide>
            <Markdown source={require("../assets/stuff.md")}></Markdown>
        </Slide>

And it shows up like so:

screen shot 2018-02-08 at 12 58 06 pm

I imagine I’m missing something trivial. I’d be happy to check out some working examples but can’t seem to find any.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ryantuckcommented, Feb 8, 2018

Oh wait, I see the subtlety now.

The ! at the very beginning of the string is the thing that matters. No need to do anything higher up in the file or anything.

// works
<Markdown source={require("!raw-loader!../assets/stuff.md")} />

// doesn't work
<Markdown source={require("raw-loader!../assets/stuff.md")} />
0reactions
ryan-roemercommented, Feb 13, 2018

For documentation sake, here is the part of the webpack config causing problems (it’s higher priority than raw-loader without the !raw-loader hack): https://github.com/FormidableLabs/spectacle-boilerplate/blob/master/webpack.config.js#L24-L27

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why You Should and Should Not Use Markdown - Peter Conrad
Markdown was not intended to replace HTML, but to augment it — it is meant as a writing tool, whereas HTML is a...
Read more >
What's Wrong with Markdown? - Adam Hyde
MD files and load it into the browser you will see just plain, boring Markdown. No nicely formatted documents for you.
Read more >
VS Code - Catch errors in your markdown files - Rob O'Leary
Formatting. The markdownlint extensions registers itself as a source code formatter for Markdown files and can be used to format your document ...
Read more >
How to indent a few lines in Markdown markup?
As a workaround I would suggest inserting a vertical bar (|) followed by hard spaces (Alt-Code on Windows: Alt+0160). This preserves the indent...
Read more >
Getting Started | Markdown Guide
When you create a Markdown-formatted file, you add Markdown syntax to the ... It's a free and open-source blogging platform with a nice...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found