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

HTML comments break parsing of "Status:", "Decider:", "Date:" & "Tags:" fields #62

Open
Philzen opened this issue Jan 27, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Philzen
Copy link
Contributor

Philzen commented Jan 27, 2022

Bug Report

Description

As soon as one starts filling out the "Deciders" or "Tags" section, any HTML comments start are showing up as such in the knowledge base (i.e. the <!-- optional --> comment).

Looking at the generated HTML, it transpires that:

  • The "Deciders" section renders the comment to &lt;!-- optional --&gt;
  • The Tags section renders the comment #&lt;!-- #optional #--&gt;

Steps to Reproduce

  1. create an ADR
  2. Fill out either "Deciders:" or "Tags"
    Actually: just putting an additional space between [list everyone involved in the decision] and <!-- optional --> is enough to trigger the behaviour
  3. Deploy or preview the knowledge base → the former HTML comments become visible

Expected Behavior

HTML comments should be ignored in generated output.

Environment

Log4brains version: 1.0.0-beta.11
Node.js version: v17.3.0.
OS and its version: Manjaro linux / whatever gitlab.com uses
Browser information: Firefox 96.0.2

Possible Solution

The parser that processes the "Deciders:" and "Tags:" section needs to be changed to recognize <!-- content --> and ignore them for processing (while still making them appear in the generated HTML output).

@Philzen Philzen added the bug Something isn't working label Jan 27, 2022
@Philzen Philzen changed the title HTML comments are parsed as "decider" or "tag" HTML comments interfere with "status", "decider" or "tag" parsing Jan 27, 2022
@Philzen
Copy link
Contributor Author

Philzen commented Jan 27, 2022

Just checked, the same problem applies to the Status: field. When any comment appears there, status is not correctly rendered and the ADR remains in status DRAFT, no matter what is actually stated as its status.

When this issue is touched, i may make sense to fix this alltogether, so i amended the issue title accordingly.

@Philzen Philzen changed the title HTML comments interfere with "status", "decider" or "tag" parsing HTML comments breask parsing of "status", "decider" or "tag" fields Jan 28, 2022
@Philzen Philzen changed the title HTML comments breask parsing of "status", "decider" or "tag" fields HTML comments break parsing of "status", "decider" or "tag" fields Jan 28, 2022
@Philzen
Copy link
Contributor Author

Philzen commented Jan 28, 2022

HTML comments are a problem for the "Date:"-field too. When a comment is placed after the date, the sorting in the knowledge base is the same as if there was no "Date:" list entry at all.

@Philzen Philzen changed the title HTML comments break parsing of "status", "decider" or "tag" fields HTML comments break parsing of "Status:", "Decider:", "Date:" & "Tags:" fields Jan 28, 2022
@tylerhubert
Copy link

@Philzen I've opened up a PR to fix this back on Jan 19th. #97 The PR has been waiting for review since then though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants