mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 12:47:26 +01:00
540ba6e74e
Implementation is inspired by already existing in Markwon image and link processing but has to work around some limitations of writing an external plugin. The first one is storing brackets ourselves. Stored brackets need to be cleared when a new block starts. Markwon does it in MarkwonInlineProcessor but there is no callback that we could use. Clearing storage from our own block parser is unreliable as it is not guaranteed to be called. Instead, every time we need to access the storage we compare current block with the last used block and clear storage if necessary. The second problem is actually a feature of Markwon that it applies spans in reverse order of calls to MarkwonVisitor#setSpansForNode. This causes other spans like links and code to be drawn over spoilers making them visible. Adding spans with a different priority doesn't help as it would require negative priority. Instead we just remove all the SpoilerSpans from the final string and add them again, so they are applied last as we want. |
||
---|---|---|
.. | ||
src | ||
build.gradle | ||
proguard-rules.pro |