Composer Buttons Plugin
-
@NedFodder said in Composer Buttons Plugin:
Issues I know about:
- Images and links in spoilers don't work on IE, but everything else does.
Fixed, mostly.
I was trying to replace the
<img>
tags with<svg>
tags so I could blur the images. The thing screwing that up was definitely the "responsive" loading and unloading of images (AKA the jellypotato fix). My fix was to add thenot-responsive
class to the spoilered images so NodeBB would leave them alone. The trade-off is that the spoilered images will cause jellypotato again (but only on IE, I was able to keep the "responsive" behavior on Chrome and FF).I blurred the link by adding some
color: transparent
to the IE-specific CSS. One last problem with the links: clicking on the link while it's blurred still activates the link instead of un-blurring the text (again, only on IE).- Images in spoilers on FF look strange after they've been revealed.
Fixed. NodeBB has a
no-select
class on some buttons that does what I want, so I applied that styling to the spoilers.I pushed these fixes to the spoiler branch if anyone wants to test it again. I checked it out on Ubuntu (latest Chrome and FF) and Win7 (IE11 and latest Chrome and FF). I'm curious to see what might break with Safari/OSX/iOS or Win10/Edge, still not sure how I can test those myself...
-
@ben_lubar said in Discussion of NodeBB Updates:
@NedFodder said in Discussion of NodeBB Updates:
and I wanted to use the old [spoiler] syntax so that the old Discourse posts work again
As long as you filter the post contents before htmlcleaner runs (priority 3 or below), you should be able to just do a string replace.
Are you suggesting replace
[spoiler]
with<details><summary>
on all the old posts? Yeah I can do that, but what would that look like? Lemme drop some examples here for a second:<details><summary>summary</summary>details</details>
summary
details<details><summary></summary>details</details>
details
<details><summary>summary</summary></details>
summary
So how would I replace
[spoiler]hidden text[/spoiler]
? #2 looks broken, and #3 is obviously wrong. So should I insert a default summary like<details><summary>Spoiler</summary>hidden text</details>
?Also consider the places where people have put
[spoiler]
in the middle of a paragraph. Inserting<details><summary>
would break the paragraph and make it look like garbage.I still say the whole
<details><summary>
approach is confusing and ugly. It breaks if you don't put text in both tags in just the right places. And it doesn't work at all in the preview pane (on FF and IE/Edge), which is bound to frustrate people that don't get the syntax right the first time.
-
@NedFodder said in Composer Buttons Plugin:
So how would I replace [spoiler]hidden text[/spoiler]?
Details without a `` tag is valid
-
hidden text
-
@NedFodder said in Composer Buttons Plugin:
I still say the whole
<details><summary>
approach is confusing and ugly.Well, you could implement your own client-side JavaScript and CSS as part of your plugin. If you need a CSS class added to the htmlcleaner whitelist for a specific tag, tell me.
-
@ben_lubar said in Composer Buttons Plugin:
Details without a
tag is valid Still, it would
break in-lindspoilers.
-
@ben_lubar said in Composer Buttons Plugin:
Details without a
tag is valid Sure, but it doesn't do anything (FF, Win7):
-
@NedFodder said in Composer Buttons Plugin:
@ben_lubar said in Composer Buttons Plugin:
Details without a
tag is valid Sure, but it doesn't do anything (FF, Win7):
That's a bug in the shim.
-
@ben_lubar said in Composer Buttons Plugin:
@NedFodder said in Composer Buttons Plugin:
So how would I replace [spoiler]hidden text[/spoiler]?
Details without a `` tag is valid
And I just discovered that my details shim for firefox does poorly when there's no summary to click to make the details visible...
-
@anotherusername said in Composer Buttons Plugin:
@ben_lubar said in Composer Buttons Plugin:
@NedFodder said in Composer Buttons Plugin:
So how would I replace [spoiler]hidden text[/spoiler]?
Details without a `` tag is valid
And I just discovered that my details shim for firefox does poorly when there's no summary to click to make the details visible...
Also, somehow or other
<details>Details without a `<summary>` tag is valid</details>
is triggering your shim, which in turn is breaking the
` `
markdown... @ben_lubar@ben_lubar said in [Composer Buttons Plugin](/post/944353): > @NedFodder said in [Composer Buttons Plugin](/post/944340): > > So how would I replace [spoiler]hidden text[/spoiler]? > > <details>Details without a `<summary>` tag is valid</details> And I just discovered that my details shim for firefox does poorly when there's no summary to click to make the details visible...
-
a
``
b
some text before it
<summary>
Looks like a markdown-it bug.
-
@ben_lubar @anotherusername actually I think I can fix this in htmlcleaner.