I know that spoiler tags don't support all the same kind of Markdown that block quotes do, specifically lists and paragraph breaks. So, I was trying to use HTML to produce the effect that I wanted, which was a bulleted list inside a spoiler.

The effect I got looked a bit strange -- there was excess space at the top and bottom of the spoiler block. so, I examined the HTML it was producing and noticed that it was creating what I'll call "dodgy" HTML. In particular, it's producing extra paragraph tags before and after the embedded HTML. Even more strange, if there's additional text after the HTML, it's not being wrapped in a<p> tag, but there's an empty <p> tag anyway.

It's probably easier to show. If I include this markup in my post:

>! <ul><li>This list is weird</li></ul>

then the HTML includes empty paragraphs before/after the HTML, which means unwanted white space inside the spoiler:

<blockquote class="spoiler">
  <p> </p><ul><li>This list is weird</li></ul><p></p>

If I actually include header/footer text, it gets even stranger:

>! Header <ul><li>List Item</li></ul> Footer

the resulting HTML that I get is:

<blockquote class="spoiler">
  <p> Header </p><ul><li>List Item</li></ul> Footer<p></p>

In particular, note the placement of the "Footer" text, which seems to be confusing Chrome:

enter image description here

1 Answer 1


Given a markdown list:

* [cftransaction](https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-t/cftransaction.html)
* [Understanding the Available Transaction Isolation Levels](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc546518%28v=technet.10%29)
* [Asynchronous Programming in JavaScript with Promises](https://docs.microsoft.com/en-us/archive/blogs/ie/asynchronous-programming-in-javascript-with-promises)
* [How Transactional Replication Works](https://www.microsoft.com/en-us/download/details.aspx?id=51958)
* [Transaction Process Synchronization](https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc977035%28v=technet.10%29)
* [Optimistic Algorithm](http://courses.cs.vt.edu/~cs5204/fall99/distributedDBMS/wen/notes.html)
* [Concurrency Control Algorithms](https://docs.telerik.com/help/openaccess-classic/concurrency-control-algorithms.html)
* [Configuring Serializable Isolation](https://download.oracle.com/berkeley-db/docs/je/1.7.1/GettingStartedGuide/serializable.html)
* [Improving concurrency with new registry variables](https://developer.ibm.com/technologies/data-management/)
* [Operating Systems Lecture Notes: Allocation and Deadlock](http://bluehawk.monmouth.edu/~rclayton/web-pages/s12-os/resourcemgt.html)
* [SQLite File I/O Specification](https://www.sqlite.org/fileio.html)
* [Broken promises–C++0x futures ](https://bartoszmilewski.com/2009/03/03/broken-promises-c0x-futures/)
* [concurrent.futures — Launching parallel tasks](https://docs.python.org/dev/library/concurrent.futures.html)
* [Javascript Is Awesome: I don't want promises](https://web.archive.org/web/20160305180903/http://javascriptisawesome.blogspot.com/2012/12/i-dont-want-promises.html)
* [JavaScript Asynchronous Architectures: Events vs. Promises](https://www.joezimjs.com/javascript/javascript-asynchronous-architectures-events-vs-promises/)
* [AS3 Promises - a guide and example](https://cwiki.apache.org/confluence/display/FLEX/AS3%20Promises%20-%20a%20guide%20and%20example)
* [Smalltalk Concurrency, Playing With Futures](http://onsmalltalk.com/smalltalk-concurrency-playing-with-futures)
* [promise-streams](https://github.com/spion/promise-streams)
* [System.Threading.TTask.Future](https://docwiki.embarcadero.com/Libraries/Seattle/en/System.Threading.TTask.Future#Description)
* [Promises Part 5: The Lego Problem](https://blog.getify.com/promises-part-5/)
* [Callbacks vs Events](http://dean.edwards.name/weblog/2009/03/callbacks-vs-events/)
* [Events and Callbacks](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/events-and-callbacks)
* [Events vs. Callbacks – when to use what](https://web.archive.org/web/20160803015353/http://www.ghost23.de:80/2010/10/events-vs-callbacks-when-to-use-which/)
* [coroutines,callbacks,message-queues - Tcl](https://wiki.tcl-lang.org/page/coroutines,callbacks,message-queues)
* [Introduction to ES6 Promises – The Four Functions You Need To Avoid Callback Hell](https://jamesknelson.com/grokking-es6-promises-the-four-functions-you-need-to-avoid-callback-hell/)
* [All about ES6 Generators](https://blog.getify.com/all-about-es6-generators/)

Run the following Find/Replace in a text editor with regex support:




>! &#8226; <a href="\2">\1</a><br>

(Use $2 and $1 instead if \2 and \1 do not work as backreferences)

to generate the equivalent spoiler version:

Understanding the Available Transaction Isolation Levels
Asynchronous Programming in JavaScript with Promises
How Transactional Replication Works
Transaction Process Synchronization
Optimistic Algorithm
Concurrency Control Algorithms
Configuring Serializable Isolation
Improving concurrency with new registry variables
Operating Systems Lecture Notes: Allocation and Deadlock
SQLite File I/O Specification
Broken promises–C++0x futures
concurrent.futures — Launching parallel tasks
Javascript Is Awesome: I don't want promises
JavaScript Asynchronous Architectures: Events vs. Promises
AS3 Promises - a guide and example
Smalltalk Concurrency, Playing With Futures
Promises Part 5: The Lego Problem
Callbacks vs Events
Events and Callbacks
Events vs. Callbacks – when to use what
coroutines,callbacks,message-queues - Tcl
Introduction to ES6 Promises – The Four Functions You Need To Avoid Callback Hell
All about ES6 Generators

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .