FIX: buildTranslationTree was erroring when translations overlapped (ie. ":-)" and ":-))")
FIX: emoji translations wasn't working properly when translations overlapped
Previously non lightboxed images would render in the wrong spot while loading.
We assumed the image we were rendering while loading was at 0,0 position.
This is not the case on non-lightboxed images cause they have no surrounding
DIV.
This allows fidelity in controlling excerpt (text that shows up when you pin a topic or link to it externally):
```
I am some text
[excerpt]
This is some **custom** markdown that should be the excerpt
[/excerpt]
More text
```
Previous solution relied on DIVs, unfortunately DIVs do not play well,
by design with mixing markdown unless you have a preceding newline eg:
```
<div class='hello'>
this will be treated properly as markdown
</div>
```
This extra newline is not desirable.
I am also considering adding
```
[div class=excerpt]
[/div]
```
This would offer lots of flexibility to themes and plugins that do not want the extra annoying newline.
- Now applied to all images over 150x150px
- Stores the width and height in the WeakMap rather than using
percentages for accuracy
- When oneboxed images are hidden, they are given a subtle border for better
visibility.
- Don't apply when in the composer. Causes flickering.
With our recent move to SVG icons, the font file does not work in the wizard. I've opted for path2D, which accepts an SVG path
Path2D is not supported by IE11 but the chances of admins running the wizard on IE11 are practically none.
https://caniuse.com/#feat=path2d
* Add category link renderer to plugin API
- lets themes/plugins override the category link display
- planning to use this in a "category icons" theme component
* small code review fix
* Code review refactor
This generates a 10x10 PNG thumbnail for each lightboxed image.
If Image Lazy Loading is enabled (IntersectionObserver API) then
we'll load the low res version when offscreen. As the image scrolls
in we'll swap it for the high res version.
We use a WeakMap to track the old image attributes. It's much less
memory than storing them as `data-*` attributes and swapping them
back and forth all the time.