Skip to content

$site.pages summary contains invalid markdown #2657

@maxigimenez

Description

@maxigimenez
  • I confirm that this is an issue rather than a question.

Bug report

Steps to reproduce

The summary provided on this.$site.pages can contain a broken markdown.

We are facing this issue on https://theheadless.dev when the summary is trimmed based on the configured characters there could be scenarios where the markdow is not valid anymore (please check the image attached).

In our case, we are setting a max length of 120 characters (summaryLength config), and the text of the image above is:

The [HyperText Transfer Protocol (HTTP)](https://developer.mozilla.org/en-US/docs/Web/HTTP#:~:text=Hypertext%20Transfer%20Protocol%20(HTTP)%20is,be%20used%20for%20other%20purposes.) is stateless, but cookies allow it to keep context consistent over the course of a session. In other words, by having our browser automatically exchange small amounts of data, we get to have websites recognise us and remember our preferences, the contents of our shopping baskets or the fact that we had just logged in to our account.

BTW this is a public repo, so feel free to check the configuration here https://github.com/checkly/theheadless.dev

What is expected?

Option A) before trimming, remove the markdown from the summary
Option B) trim the text without counting markdown characters, so it ensures that is always valid.

What is actually happening?

As attached below, the markdown is invalid so it looks weird.

Other relevant information

Screenshot 2020-10-12 at 12 21 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions