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.

Reference link double on format

See original GitHub issue

On 2 or more save of a file, two list of references are generated. One outside off the begin/end tag and one in. I get really inconsistent results with setting in and out of the workspace but never one where it works.

Steps to Reproduce the Bug or Issue

  1. create a file with a wikilink to an exisiting file like:
# Python style guide

We use the [[Guidelines/Python-style-guide]] with some modifications.

[//begin]: # "Autogenerated link references for markdown compatibility"
[Guidelines/Python-style-guide]: ../../Guidelines/Python-style-guide "Python language rules"
[//end]: # "Autogenerated link references"
  1. Press control S and you get
# Python style guide

We use the [[Guidelines/Python-style-guide]] with some modifications.

[Guidelines/Python-style-guide]: ../../Guidelines/Python-style-guide "Python language rules"

[//begin]: # "Autogenerated link references for markdown compatibility"
[Guidelines/Python-style-guide]: ../../Guidelines/Python-style-guide "Python language rules"
[//end]: # "Autogenerated link references"

Expected behavior

You should get

# Python style guide

We use the [[Guidelines/Python-style-guide]] with some modifications.

[//begin]: # "Autogenerated link references for markdown compatibility"
[Guidelines/Python-style-guide]: ../../Guidelines/Python-style-guide "Python language rules"
[//end]: # "Autogenerated link references"

I have tried blocking all rules in mardownlint.config but it changed nothing

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidAnsoncommented, Nov 15, 2022

@MalcolmMielle I assume you are using VS Code. If I create a new Markdown document with the content you show above and run the “Fix all supported markdownlint violations in the document” command, I get the following as expected:

# Python style guide

We use the [[Guidelines/Python-style-guide]] with some modifications.

[Guidelines/Python-style-guide]: ../../Guidelines/Python-style-guide "Python language rules"

If you want to leave the “//begin” and “//end” comments alone, the following configuration does so:

{
  "MD053": {
    "ignored_definitions": [
      "//begin",
      "//end"
    ]
  }
}

With that configuration in place, no issues are reported/fixed.

This all seems correct. If you see otherwise, please try running the markdownlint fix command as I am directly - you may have another extension trying to apply fixes on save and interfering.

I’m using the latest VS Code and markdownlint extension v0.48.1.

1reaction
DavidAnsoncommented, Nov 11, 2022

Glad you got this sorted out! I will have a look anyway, because this behavior is not expected. That rule is trying to remove the two definitions above and below that line and it works fine individually (see playground below). I can’t test bulk fix from my phone, but will do so later. However, even with a bug, I don’t understand how you would end up with two copies of the reference that isn’t being removed.

https://dlaa.me/markdownlint/#%25m%23 Python style guide We use the [[Guidelines%2FPython-style-guide]] with some modifications. [%2F%2Fbegin]%3A %23 "Autogenerated link references for markdown compatibility" [Guidelines%2FPython-style-guide]%3A ..%2F..%2FGuidelines%2FPython-style-guide "Python language rules" [%2F%2Fend]%3A %23 "Autogenerated link references"

Read more comments on GitHub >

github_iconTop Results From Across the Web

How should I format my references in APA Style? - WriteAnswers
Unless your program or instructor directs you to do otherwise, your references should be double spaced (APA, 2020, p. 303).
Read more >
APA 7th Edition Style Guide: Formatting Your Paper
Use double-spacing throughout the entire paper.To add double-spacing in Microsoft Word, highlight all the text you want double-spaced, ...
Read more >
How to Break or Split URLs (Web Addresses) Across Lines in ...
If you have any citations in your references list that include web site ... break naturally on a hyphen, technically that is not...
Read more >
APA Reference Page Examples and Format Guide
The reference citations are double spaced with no additional lines between them. References that go past the first line have a hanging indent....
Read more >
General Format - Purdue OWL
Your essay should be typed and double-spaced on standard-sized paper (8.5" x ... four major sections: the Title Page, Abstract, Main Body, and...
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