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

Stop using roaster for rendering markdown #559

Merged
merged 9 commits into from Apr 25, 2019

Conversation

Projects
None yet
2 participants
@rafeca
Copy link
Contributor

commented Apr 23, 2019

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

In order to fix #206, the version of the marked package needed to be upgraded. Since this package depended on roaster, which is unmaintained and not even recommended to be used by its own creator, I've opted to replace it by directly calling marked and implementing in this package the missing functionality.

Alternate Designs

I could have forked roaster (in fact a really old fork of it already exists on the atom org: http://github.com/atom/roaster) and then upgrade marked from that fork, but I prefer to avoid having yet another fork and yet another package to maintain.

Benefits

Fixes #206

Possible Drawbacks

N/A

Applicable Issues

#206

rafeca added some commits Apr 23, 2019

Replace roaster by marked
This allows us to use marked directly, but we need to implement two
things that were provided by roaster:

- Handle the yaml frontmatter tags.
- Convert github emoji tags (e.g 🚀) to the actual emojis.

@rafeca rafeca force-pushed the deprecate-roaster branch from 832e085 to 3245335 Apr 23, 2019

@rafeca

This comment has been minimized.

Copy link
Contributor Author

commented Apr 23, 2019

In order to verify that the extension keeps working correctly, I've used the following markdown file:

https://gist.github.com/rafeca/7220f08c6d7d340533b3c323290ac507

Using standard style:

Screen Shot 2019-04-23 at 20 37 47

Using GitHub style:

Screen Shot 2019-04-23 at 20 38 08

@rafeca rafeca requested a review from atom/maintainers Apr 24, 2019

@nathansobo
Copy link
Contributor

left a comment

This all seems reasonable. There's only one hole in the emoji handling I could think of, but I'm not sure it's worth fixing. If for some reason someone were to use an emoji string inside a URL, it would break rendering. Like this: [:finnadie:](https://foo.com/:finnadie:/). I think that's a valid URL, but I don't really think anybody would ever do something like this. So I say 🚢.

@rafeca

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

If for some reason someone were to use an emoji string inside a URL, it would break rendering. Like this: :finnadie:.

Good point! yeah this whole emoji thing is quite fragile (the logic in this PR mimics the one that we had before with roaster).

I wonder if we could get rid of the :colonemoji: handling for Markdown files (which also adds ~5.5MB to Atom due to all the emoji images being included in the app via the emoji-images packages), but I guess that this is such a distinctive GitHub feature that it's hard to justify removing it.

@rafeca rafeca merged commit 737c630 into master Apr 25, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@rafeca rafeca deleted the deprecate-roaster branch Apr 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.