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

Feature: custom render #71

Closed
wants to merge 2 commits into from

Conversation

elevatebart
Copy link
Contributor

In vue-live and to simplify the reading of examples, we have a pseudo-jsx language not supported by prism.

Essentially it's JS until the first "<" sign.

To avoid odd bugs, I added a highlight prop. It expects a function exactly with the same prototype as prism: function highlight(sourceCode, language) and return html highlighted code.

Thank you in advance.

@koca
Copy link
Owner

koca commented May 13, 2020

Hey @elevatebart, thanks for the PR! I'm not sure if this will play well with the editor's internals. Say you changed/updated/added a char in your custom highlight function it will cause focus issues etc. So I need to test this before merging it. I'll take a look this weekend. Thanks 😊

@koca
Copy link
Owner

koca commented May 19, 2020

Hey @elevatebart, just tried and this is a great idea and it works when the highlight function returns html(AFAIK). Doesn't work if you add or remove a char.

@koca
Copy link
Owner

koca commented May 21, 2020

Update: Im working on this issue and the next version of vue-prism-editor. So stay tuned 😊

@elevatebart
Copy link
Contributor Author

oooooooh !! can't wait !!

@elevatebart
Copy link
Contributor Author

Hello @koca ,

I am open to peer programming on this one of these days.
We should look at this together.

Bart

@koca
Copy link
Owner

koca commented May 26, 2020

Hey @elevatebart Great idea! i'd love to pair. But its almost done. New version will support this feature by default. After i release the new version we can do pair :)

@koca koca mentioned this pull request Jun 21, 2020
@koca
Copy link
Owner

koca commented Aug 8, 2020

Released new version v1 🎉

@koca koca closed this Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants