Bug: Tags Duplicated when Whitespace around Tag in YAML
See original GitHub issueDescribe 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:
-
My Linter settings:
-
I did the following first:
- I had some tags in YAML,
moc
androadmap
- Then I added test1 test2 test3 to the article, which at the moment is formatted using linter and everything works perfectly
- I had some tags in YAML,
-
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, -
Then use Linter to format the file,
todo' is missing
,`- with an extra
test3
at the end
Question 2:
Must have tags in YAML and tag #
in the article content.
-
If tags end with a space(
bcd ]
) or start with a space([ abc
), like:--- tags: [ abc, bcd] --- # h111111 #bcd * 11111 * 2222 #abc
-
The latest tag will add again.
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:
- Created a year ago
- Comments:10
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.