0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/core/test/unit
Nazar Gargol 16c3785b52 🐛 Fixed lack of space in excerpt generated from paragraphs
closes #10531

- Adds space when encountering closing </p> and <br> tags
- The mobiledoc-to-html conversion produces these tags in this exact
syntax, so there is no need to account for more cases like additional spaces or alternative syntax like  <br />
- Added test cases that cover spacing use-casei
- Changed some existing tests to contain more close-to-real-world markup
- The downside of this approach is generating multiple spaces in case there are empty paragraphs in the markup. The same concern is true for current "new line" substitution:
> excerpt.replace(/(\r\n|\n|\r)+/gm, ' ')
but it never has been a concern as in real world when multiple spaces are used inside of the `<p>` tag they are rendered as single space.
2019-08-26 18:05:14 +02:00
..
adapters Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
api Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
apps Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
config Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
data 🐛 Fixed lack of space in excerpt generated from paragraphs 2019-08-26 18:05:14 +02:00
helpers 🐛 Fixed lack of space in excerpt generated from paragraphs 2019-08-26 18:05:14 +02:00
lib Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
models Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
public Refactored Ghost SDK unit test 2018-10-05 16:49:46 +02:00
services Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
web Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00