-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Optimization of code block #1445
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. XML issue:
Coping a full document with XML code blocks destroy the XML code lines.
foo
\```xml
<BookCatalogue xmlns="http://example.org">
<Book>
<Title>Foo Bar</Title>
<author>Bar Fo</Author>
<Date>0</Date>
<ISBN>81-40-34319-4</ISBN>
</Book>
</BookCatalogue>
\```
bar
2. Ctrl+A Stack Trace:
vue.esm.js?a026:628 [Vue warn]: Error in event handler for "selectAll": "IndexSizeError: Failed to execute 'extend' on 'Selection': There is no child at offset 658."
vue.esm.js?a026:1897 DOMException: Failed to execute 'extend' on 'Selection': There is no child at offset 658.
at Selection.extend (<anonymous>)
at Selection.setFocus (webpack-internal:///./src/muya/lib/selection/index.js:371:15)
at Selection.setCursorRange (webpack-internal:///./src/muya/lib/selection/index.js:524:10)
at ContentState.setCursor (webpack-internal:///./src/muya/lib/contentState/index.js:194:56)
at ContentState.partialRender (webpack-internal:///./src/muya/lib/contentState/index.js:258:12)
at ContentState.selectAll (webpack-internal:///./src/muya/lib/contentState/paragraphCtrl.js:952:19)
at Muya.selectAll (webpack-internal:///./src/muya/lib/index.js:388:25)
at VueComponent.handleSelectAll (webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./src/renderer/components/editorWithTabs/editor.vue?vue&type=script&lang=js&:701:21)
at invokeWithErrorHandling (webpack-internal:///./node_modules/vue/dist/vue.esm.js:1862:26)
at Vue.$emit (webpack-internal:///./node_modules/vue/dist/vue.esm.js:3885:9)
Example:
Ctrl+A
in special code blocks no longer works. Paste example below and Ctrl+A
inside code block.
foo
\```xml
<?xml version="1.0" encoding="UTF-8"?>
<BookCatalogue xmlns="http://www.publishing.org">
<Book>
<Title>Yogasana Vijnana: the Science of Yoga</Title>
<author>Dhirendra Brahmachari</Author>
<Date>1966</Date>
<ISBN>81-40-34319-4</ISBN>
<Publisher>Dhirendra Yoga Publications</Publisher>
<Cost currency="INR">11.50</Cost>
</Book>
<Book>
<Title>The First and Last Freedom</Title>
<Author>J. Krishnamurti</Author>
<Date>1954</Date>
<ISBN>0-06-064831-7</ISBN>
<Publisher>Harper & Row</Publisher>
<Cost currency="USD">2.95</Cost>
</Book>
</BookCatalogue>
\```
foo
3. First line issue
Paste example below and, switch to preview mode and press Enter
followed by Arrow-Up
. The cursor jumps to the language identifier and not first line.
```cpp int i = 0; ```
I can not reproduce this issue, where is the cursor before press Enter and Arrow-Up? |
How strange, there must be some special characters that cause this issue, because it get ok after I edit some new content in the code block. It's due to |
Description
cpp
andc
language code fences #1294[Feature] Add copy button on the top right of code block for copy the code block content.octokit/rest
andurl-loader
deps.This change is