fastn-stack / fastn

🚧 (Alpha stage software) fastn - better way to build websites 🚧
https://fastn.com
GNU Affero General Public License v3.0
468 stars 36 forks source link

Bug Report: The markdown strikethrough is not working #1958

Open Arpita-Jaiswal opened 3 weeks ago

Arpita-Jaiswal commented 3 weeks ago

The ~~text~~ syntax in fastn should apply the text-decoration: line-through CSS to the text.

However, it is not working as expected because the global CSS rule:

*, :after, :before {
    text-decoration: none;
    ...
}

is overriding the specific rule for the <del> element:

del {
    text-decoration: line-through;
}

Steps to Reproduce:

  1. Use the following FTD syntax:
    -- ftd.text: This ~~sentence is grammatically wrong~~, correct it.
  2. Observe that the text is not struck through.

Expected Behavior:

Text wrapped in the ~~ markdown syntax should be displayed with a line-through effect.

Example:

-- ftd.text: This ~~sentence is grammatically wrong~~, correct it.

Expected output:

This sentence is grammatically wrong, correct it.

Suggested Fix:

To ensure that the del element's text-decoration: line-through is applied, we need to add !important to the rule:

del {
    text-decoration: line-through !important;
}

Environment:

Reported by Sneha Upadhyay on discord.

Arpita-Jaiswal commented 3 weeks ago

PR: https://github.com/fastn-stack/fastn/pull/1959