Skip to content
This repository was archived by the owner on Jan 16, 2018. It is now read-only.

Adding markdown loader, readme page. - #45

Merged
sokra merged 2 commits into
webpack:masterfrom
barrystaes:master
Mar 9, 2015
Merged

sokra merged 2 commits into
webpack:masterfrom
barrystaes:master

Conversation

@barrystaes

Copy link
Copy Markdown
Contributor

The readme says markdown should be supported, this fixes that.
Also added page example that just shows README.md

Comment thread app/Readme/index.jsx Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change it to this?

        var readme = { __html: require("./../../README.md") };
        return <div style={style.default} dangerouslySetInnerHTML={readme}></div>;

@barrystaes

Copy link
Copy Markdown
Contributor Author

Thanks @sokra, fixed both.
PS. What is the argument for applying the __html key early on.. security, or keeping render() brief?

@sokra

sokra commented Mar 6, 2015

Copy link
Copy Markdown
Member

PS. What is the argument for applying the __html key early on.. security, or keeping render() brief?

I think it intended to mark html strings with {__html: "..."} when passing them around. So you could find bugs when dangerouslySetInnerHTML is used with a normal string.

var a = {__html: "..."};
var b = getSomething(...);

<div dangerouslySetInnerHTML={condition ? a : b} />

Not obvious whether getSomething returns something html safe. By using the {__html} marker it'll tell use if it was just a string (which shouldn't be used because of security issues).

@barrystaes

Copy link
Copy Markdown
Contributor Author

OK i see; this way searching for __html surfaces dangerous html usage at the source.

@barrystaes

Copy link
Copy Markdown
Contributor Author

PS. In my inexperience i did this in my master branch, which of course is not practical for my development. If you could reject or accept this PR soon it would be much appreciated. :)

@sokra
sokra merged commit ac6acff into webpack:master Mar 9, 2015
@sokra

sokra commented Mar 9, 2015

Copy link
Copy Markdown
Member

Sure

@sokra

sokra commented Mar 9, 2015

Copy link
Copy Markdown
Member

Thanks for the PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants