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

Use TextEditors to render code blocks, remove highlights #69

Merged
merged 1 commit into from Aug 8, 2018

Conversation

Projects
None yet
2 participants
@maxbrunsfeld
Contributor

maxbrunsfeld commented Aug 7, 2018

This PR updates the style guide to render HTML code blocks using TextEditors. This way, we follow Atom's normal logic for selecting a grammar based on the core.useTreeSitterParsers setting. This removes a dependency on highlights.

Fixes atom/atom#16581

@maxbrunsfeld maxbrunsfeld merged commit 85edba8 into master Aug 8, 2018

2 checks passed

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

@maxbrunsfeld maxbrunsfeld deleted the mb-text-editor-code-blocks branch Aug 8, 2018

@lierdakil

This comment has been minimized.

Show comment
Hide comment
@lierdakil

lierdakil Aug 22, 2018

A quick question: is there a workaround in case I can't use TextEditors to highlight a thing? Because markdown-preview-plus uses a separate context via a webview, it can't use TextEditors directly. It still needs to highlight stuff though. Until now, I've been using a stripped-down fork of highlights, but it evidently doesn't work with tree sitter grammars.

lierdakil commented Aug 22, 2018

A quick question: is there a workaround in case I can't use TextEditors to highlight a thing? Because markdown-preview-plus uses a separate context via a webview, it can't use TextEditors directly. It still needs to highlight stuff though. Until now, I've been using a stripped-down fork of highlights, but it evidently doesn't work with tree sitter grammars.

@maxbrunsfeld

This comment has been minimized.

Show comment
Hide comment
@maxbrunsfeld

maxbrunsfeld Aug 22, 2018

Contributor

For the save-html command, I create a text editor but then extract out its contents to produce plain HTML. Not sure if that approach would work in your case.

Contributor

maxbrunsfeld commented Aug 22, 2018

For the save-html command, I create a text editor but then extract out its contents to produce plain HTML. Not sure if that approach would work in your case.

@lierdakil

This comment has been minimized.

Show comment
Hide comment
@lierdakil

lierdakil Aug 22, 2018

It might work... I believe I could make it work. Wouldn't that be incredibly brittle though? I mean, direct DOM manipulation of an internal view component even sounds brittle... Or am I missing something?

Anyway, thanks for the hint!

lierdakil commented Aug 22, 2018

It might work... I believe I could make it work. Wouldn't that be incredibly brittle though? I mean, direct DOM manipulation of an internal view component even sounds brittle... Or am I missing something?

Anyway, thanks for the hint!

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