Ghost/core/test/unit/helpers
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
..
test_tpl Attr pass-thru & full context in partial helpers 2019-03-09 21:21:01 +00:00
asset_spec.js Extracted frontend folder (#10780) 2019-06-19 11:30:28 +02:00
author_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
authors_spec.js Extracted frontend folder (#10780) 2019-06-19 11:30:28 +02:00
body_class_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
concat_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
content_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
date_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
encode_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
excerpt_spec.js 🐛 Fixed lack of space in excerpt generated from paragraphs 2019-08-26 18:05:14 +02:00
facebook_url_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
foreach_spec.js Extracted frontend folder (#10780) 2019-06-19 11:30:28 +02:00
get_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
ghost_foot_spec.js Extracted frontend folder (#10780) 2019-06-19 11:30:28 +02:00
ghost_head_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
has_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
img_url_spec.js Updated @tryghost/url-utils to v0.2.0 (#11004) 2019-08-12 09:31:42 +01:00
index_spec.js Added {{link_class}} helper 2019-08-05 12:12:05 +01:00
is_spec.js Extracted frontend folder (#10780) 2019-06-19 11:30:28 +02:00
lang_spec.js Extracted frontend folder (#10780) 2019-06-19 11:30:28 +02:00
link_class_spec.js Added {{link_class}} helper 2019-08-05 12:12:05 +01:00
link_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
meta_description_spec.js Added global site SEO fields to be used in theme helpers (#10930) 2019-07-25 11:08:29 +02:00
meta_title_spec.js Added global site SEO fields to be used in theme helpers (#10930) 2019-07-25 11:08:29 +02:00
navigation_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
next_post_spec.js Extracted frontend folder (#10780) 2019-06-19 11:30:28 +02:00
page_url_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
pagination_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
plural_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
post_class_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
prev_post_spec.js Extracted frontend folder (#10780) 2019-06-19 11:30:28 +02:00
reading_time_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
t_spec.js Extracted frontend folder (#10780) 2019-06-19 11:30:28 +02:00
tags_spec.js Extracted frontend folder (#10780) 2019-06-19 11:30:28 +02:00
template_spec.js Extracted frontend folder (#10780) 2019-06-19 11:30:28 +02:00
title_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
twitter_url_spec.js Updated tests eslint config to use eslint-plugin-ghost@0.5.0 2019-08-19 13:38:35 +01:00
url_spec.js Updated @tryghost/url-utils to v0.2.0 (#11004) 2019-08-12 09:31:42 +01:00
utils_spec.js Updated to use count words/images helpers from SDK (#10686) 2019-04-16 08:00:01 +05:30