norandom is having trouble overriding the span tag in Discourse to use dropcaps. vinothkannans explains that any CSS classes added to the HTML will be stripped by the Discourse markdown parser and suggests whitelisting the CSS class with a plugin.
vinothkannans provides a JavaScript code snippet to whitelist the span tag with the dropcap class, but norandom is unable to get it working due to an error.
cpradio and vinothkannans provide alternative solutions, with cpradio’s approach requiring a specific file path and contents to whitelist the span.dropcaps class in Discourse. However, norandom is still having trouble getting it to work.
Usually instead of .dropcap I would have used span. For Discourse that’s not a good idea. The CSS theme editor doesn’t like you to mess with span due to the syntax highlighting.
<span class="dropcap">I</span> can use Dropcaps. Not.
The class isn’t usable…
I have stuff in my CSS like
.topic-body{
min-width: 65%;
}
Works. But I cannot define new classes? Is there anything I am missing?
Any css classes that you add to that html will be stripped by the Discourse markdown parser. If you need to you can whitelist css classes with a plugin.
plugin-third-party-9f5ae545c7453c0bb91cd02e51f991ddd61a060df40c58f468de9f1f46d2f23d.js:1 Uncaught TypeError: Cannot read property 'whiteListTag' of undefined
at plugin-third-party-9f5ae545c7453c0bb91cd02e51f991ddd61a060df40c58f468de9f1f46d2f23d.js:1
at plugin-third-party-9f5ae545c7453c0bb91cd02e51f991ddd61a060df40c58f468de9f1f46d2f23d.js:1
Not sure why. I rarely code JS. Tried an import (latest commit), but I highly doubt that I need that tbh..