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: Tags Duplicated when Whitespace around Tag in YAML

See original GitHub issue

Describe the Bug

When there is a tag in the file and the front also has a tag, duplicate tags are generated and there are problems with the YAML format.

How to Reproduce

Question 1:

  1. My Linter settings: image image

  2. I did the following first:

    1. I had some tags in YAML, moc and roadmap
    2. Then I added test1 test2 test3 to the article, which at the moment is formatted using linter and everything works perfectly
  3. Then I add tags #todo and #doing to the end of the YAML, using the symbol # for smart hints. The file’s tags are like this, image

  4. Then use Linter to format the file, image

    • todo' is missing ,`
    • with an extra test3 at the end

Question 2:

Must have tags in YAML and tag # in the article content.

  1. If tags end with a space(bcd ]) or start with a space([ abc), like:

    ---
    tags: [ abc, bcd]
    ---
    
    # h111111
    
    #bcd
    
    * 11111
    * 2222 #abc
    
  2. The latest tag will add again. image

Expected Behavior

Should probably be added without duplicating the tag and have the correct formatting.

tags: [moc, roadmap, test1, test2, test3, todo, doing]

Device

  • Desktop

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
pjkaufmancommented, Nov 6, 2022

There may be a future based on this issue. Can the corresponding tag in YAML be automatically deleted when the tag is deleted from the article content?

Maybe it could be implemented like this linter-yaml-title-alias function.

This would have to be another FR since it is a bit different. The only problem is this gets really tricky if you have tags that are not in the YAML front matter that you want to keep.

0reactions
pjkaufmancommented, Nov 8, 2022

This issue should be resolved on master and the next release. Please let us know if this is not resolved on either master or the next release (I plan to release the bug fixes today or tomorrow). Feel free to put in the feature request for the keeping of tags in sync with the body content.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Duplicates are being allowed if tag contains whitespace #76
Adding the same tag with differing whitespaces at the end of the string allows duplicates to be stored. ... I was expecting the...
Read more >
Remove every white space between tags using JavaScript
All of these except <pre> are CDATA which means the content is not HTML and are parsed until the closing tag is found,...
Read more >
Tagging AWS resources - AWS General Reference
In general, the allowed characters are letters, numbers, spaces representable in UTF-8, and the following characters: _ . : / = + -...
Read more >
YAML Ain't Markup Language (YAML™) Version 1.1
YAML tags are used to associate meta information with each node. In particular, each tag must specify the expected node kind (scalar, sequence, ......
Read more >
Frontend: The schema for `.gitlab-ci.yml` is missing support for ...
I pinged someone from groupeditor on the MR and we're looking into how to fix the bug. Adding the workflowblocked label in the...
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