question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: Two lines around Code Fences.

See original GitHub issue

Describe the Bug

Will add two lines around Code Fences.

How to Reproduce

Steps to reproduce the behavior:

  1. Enable Empty Line Around Code Fences
  2. Enable Consecutive blank lines

Expected Behavior

A clear and concise description of what you expected to happen.

Expected output if applicable:

The formatted result:

``` markdown
1. 修改 php.ini


    ```
    upload_max_filesize = 20M
    post_max_size = 20M
    ```


2. 修改 Nginx 配置文件


    ```
    client_max_body_size    20m; # 文件最大大小
    ```


1111

```
int a = 0;
```

2222
```

The code block not in the list is correct, it is around with a blank line. The code block in the list will be around two blank lines. I think the code block around with one line is correct.

Device

  • Desktop

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
pjkaufmancommented, Oct 26, 2022

This should be taken care of now. It will be pushed out with the next release. If you would like, you may go ahead and use the master version of the plugin before then.

Please let us know if the issue persists either on master or in the next release.

0reactions
pjkaufmancommented, Oct 26, 2022

Looks like I have a fix for the bug. The issue is that it was trying to match the whitespace of it with that of the previous line which is technically how it was written, but I see that that is not really necessary, so I have gone ahead and removed that part of the logic. This should take care of the problem and will hopefully not create any others.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inline code blocks in code fence mode - bug - Discourse Meta
In 4SI mode, the </> button has two very different behaviors, one where you select just part of a line (Example 1), and...
Read more >
A problem with backtick code fences - #20 by pothibo - Spec
this I think is a clear bug — shouldn't a line starting with 3 backticks parse either as inline code or code block?!...
Read more >
Code fences that don't specify language have abnormal line ...
I have some code fences where I just have plaintext, so I leave them as just 3 backticks without a language suffix.
Read more >
Sometimes diff isn't shown in edits to code inside source fences
It seems the visual highlight of revision/code differences in source fences is currently broken for some posts in the suggested edits review ...
Read more >
Off-by-one error - Wikipedia
An off-by-one error or off-by-one bug is a logic error involving the discrete equivalent of a boundary condition. It often occurs in computer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found