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

Markdown source with code blocks does not get marked up properly #2639

Open
ghost opened this issue Nov 24, 2018 · 6 comments
Open

Markdown source with code blocks does not get marked up properly #2639

ghost opened this issue Nov 24, 2018 · 6 comments
Labels
improvement request 🔨 Issue concerns an existing feature that needs improvement.

Comments

@ghost
Copy link

ghost commented Nov 24, 2018

Current behavior

markdown source render error, text between two source code framents is highlighted as source code.
for example:

some code here

content here

some code here

content between source code fragments is also highlighted

Expected behavior

the content between two source code should render as normal text, rather than highlighted.

Steps to reproduce

  1. just paste the text below in a markdown file
    # test
    ```c
    int creat(const char *pathname, mode_t mode);
    ```
    text here
    ```c
    int open(path, O_WRONLY | O_CREAT | O_TRUNC, mode);
    ```
    text here
    ```c
    #include <unistd.h>
    int close(int fd);
    ```
  2. add a new line after #test,text here should rendered as code as well

Environment

  • Version :0.11.11
  • OS Version and name :deepin 15.8 with 4.15.0 kernel
@ZeroX-DG ZeroX-DG added bug 🐛 Issue concerns a bug. needs investigation 🔬 Issue requires further investigation to locate or narrow down the problem. labels Nov 25, 2018
@alexalex8
Copy link

I noticed the same issue and the issue doesn't exist in 1.11.10. Following picture shows the behavior.

bug

Code I used is below, basically just copy and paste the same block multiple times. Then to reproduce the issue

  1. Click the note
  2. Scroll down then up a couple of times.
# Bug
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```

## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```
## Test
```java
  new FibonacciTest(0, 0).test()
  new FibonacciTest(1, 1).test()
  new FibonacciTest(6, 8).test()
```

@alexalex8
Copy link

Caused by

commit f1ca06daf5fc2447abe031fbfda6617586686832
Author: Baptiste Augrain <daiyam@zokugun.org>
Date:   Sat Nov 10 12:33:07 2018 +0100

    fold markdown's headings

diff --git a/lib/main.html b/lib/main.html
index 64add406..c47da9e4 100644
--- a/lib/main.html
+++ b/lib/main.html
@@ -117,6 +117,7 @@
   <script src="../node_modules/codemirror/addon/search/jump-to-line.js"></script>
 
   <script src="../node_modules/codemirror/addon/fold/brace-fold.js"></script>
+  <script src="../node_modules/codemirror/addon/fold/markdown-fold.js"></script>
   <script src="../node_modules/codemirror/addon/fold/foldgutter.js"></script>
   <script src="../node_modules/codemirror/addon/fold/foldcode.js"></script>

sounds like a node module issue.

@alexalex8
Copy link

Beside the problem caused by ToC, I can confirm the behavior of original report by adding a new line after first text here.

and looks like it's caused by change

git show 157eb5f87b66809c489d634ff86b8def5078a561
commit 157eb5f87b66809c489d634ff86b8def5078a561 (refs/bisect/bad)
Merge: 69691bdf 8f290c2a
Author: Junyoung Choi (Sai) <fluke8259@gmail.com>
Date:   Thu Nov 8 14:35:56 2018 +0900

    Merge pull request #2346 from daiyam/text-deflist
    
     add support to abbreviations, definition lists and subscript/superscript text

@Flexo013 Flexo013 added improvement request 🔨 Issue concerns an existing feature that needs improvement. and removed bug 🐛 Issue concerns a bug. needs investigation 🔬 Issue requires further investigation to locate or narrow down the problem. labels Jul 21, 2019
@Flexo013
Copy link
Contributor

#3129 contains a nice screenshot displaying this issue clearly.

@Flexo013 Flexo013 changed the title markdown source not render correctly Markdown source with code blocks does not get marked up properly Jul 21, 2019
@pquinones
Copy link

Is there any update on this issue? , im using 0.15.3 and still having this problem with code blocks...

@Flexo013
Copy link
Contributor

Any updates would have been in this thread. So sadly there hasn't been any progress.

If you would like incentivize developers to pick up this issue, then fund this issue on IssueHunt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement request 🔨 Issue concerns an existing feature that needs improvement.
Projects
None yet
Development

No branches or pull requests

4 participants