Add a snippet to visualise faulty stylesheets (#6268)

* Add a snippet to visualise faulty stylesheets

As discussed in https://github.com/Jermolene/TiddlyWiki5/issues/6176, a faulty stylesheet can propagate and break several other stylesheets. This can be tricky to debug in a wiki with a lot of custom stylesheets.

This wikitext snippet will display a list of the stylesheets created/modified by the user and will display a red cross next to the one causing a parsing error.

* Improve the css code and add a message

This commit add a short message that provide guidance on how to fix the CSS error(s).
This commit is contained in:
Telumire 2021-11-25 18:49:28 +01:00 committed by GitHub
parent 7b311b0e4a
commit 6ea7140e8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
title: $:/snippets/DebugStylesheets
Broken stylesheets will have a red cross next to their name :
<style>[test]{list-style:'❌'}</style>
<ul>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Stylesheet]has[modified]]" counter=n>
<style>{{!!text}}[test="<<n>>"]{list-style:disc;}</style>
<li test=<<n>>><$link/></li>
</$list>
</ul>
Replace "list-style:disc;" by "display:none;" to only display the stylesheets with css syntax error.
These may contains [[unclosed block(s)|https://www.w3.org/TR/css-syntax-3/#consume-a-simple-block]], please review and fix them to prevent tiddlywiki's interface from malfunctioning.