thomvaill / log4brains

✍️ Log and publish your architecture decisions (ADR)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Knowledge base crashes on HTML comment paragraphs

Philzen opened this issue · comments

Bug Report

Description

When any section of the MADR contains an HTML comment in a separate paragraph, the front end just crashes with "An unexpected error has occurred". Live reload seems to break down in that moment as the front end does not recover when the offending comment is reverted. A reload is required for it to work again.

Not reverting and navigating to the URL of another ADR also works, however the knowledge base will crash again when clicking on the ADR holding the offending HTML comment paragraph.

HTML comments beginning and ending at the end of a list entry or heading do not trigger this error.

Crashed knowledge base

image

Console error

image

Steps to Reproduce

  1. Create a new ADR
  2. Start up log4brains preview (can also be running already, does not matter)
  3. Move any of the comments in the template on their own paragraph, i.e. place the mouse course in front of <!-- optional -->, hit enter, and save the file.

Alternatively you can enter any HTML comment anywhere (except at the end of lists or headings) in an existing ADR.

Expected Behavior

The knowledge base should not crash.

Context

While drafting, I like to keep some of the initial comments found in square brackets in every template as a guideline for the team members that i am currently introducing to the ADR process, as i find them pretty well written and thus, helpful.

So i wanted to make them HTML comments that's how i discovered this behaviour.

Environment

Log4brains version: 1.0.0-beta.11
Node.js version: v17.3.0
OS and its version: Manjaro Linux
Browser information: Firefox 96.0.2 | Chromium 97.0.4692.99

Possible Solution