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

Prism4j internal error. Number of entry nodes is greater that the text length. #192

Closed
xiaoyvyv opened this issue Feb 11, 2020 · 2 comments
Labels
Milestone

Comments

@xiaoyvyv
Copy link

Markwon version: 4.2.1

When I type :

```Java

in the EditText (Markwoneditortextwatcher has been set),And an error has occurred:

java.lang.RuntimeException: 
Prism4j internal error. Number of entry nodes is greater that the text length.Nodes: [TextImpl{literal=''}]

Java code:

        markwon = Markwon.builder(activity)
                .usePlugin(JLatexMathPlugin.create(ConvertUtils.dp2px(18)))
                .usePlugin(SyntaxHighlightPlugin.create(prism4j, prism4JThemeDarkula))
                .usePlugin(TablePlugin.create(activity))
                .usePlugin(TaskListPlugin.create(activity))
                .usePlugin(GlideImagesPlugin.create(activity))
                .usePlugin(StrikethroughPlugin.create())
                .usePlugin(HtmlPlugin.create())
                .usePlugin(ImagesPlugin.create(plugin -> {
                    plugin.addSchemeHandler(FileSchemeHandler.create());
                    plugin.addSchemeHandler(DataUriSchemeHandler.create());
                    plugin.addSchemeHandler(FileSchemeHandler.create());
                }))
                .build();


        final MarkwonEditor editor = MarkwonEditor.builder(markwon)
                .useEditHandler(new EmphasisEditHandler())
                .useEditHandler(new StrongEmphasisEditHandler())
                .build();

        MarkwonEditorTextWatcher textWatcher = MarkwonEditorTextWatcher.withPreRender(editor, Executors.newSingleThreadExecutor(), editText);
        editText.addTextChangedListener(textWatcher);
@noties noties added the bug label Feb 14, 2020
@noties noties added this to the 4.2.2 milestone Feb 14, 2020
@noties
Copy link
Owner

noties commented Feb 14, 2020

Hello @xiaoyvyv !

I can confirm this issue, thanks for reporting!

@noties
Copy link
Owner

noties commented Feb 14, 2020

The fix is in latest 4.2.2-SNAPSHOT

@noties noties mentioned this issue Feb 26, 2020
@noties noties closed this as completed Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants