Skip to content

Trim blank HTML lines #478

@Poldraunic

Description

@Poldraunic

Hi!

What would be the best way to trim blank HTML lines? I am currently doing it like that:

const let blankLine = '...'
editor.getHTML()
    .replace(new RegExp(`^(${blankLine})+`), '')
    .replace(new RegExp(`(${blankLine})+$`), ''))

It works, but relies on maintaining blankLine variable in check with default style -- it is not a huge problem, but is easy to miss.

Is it possible to introduce some helpers so that I can get the line back out from Squire itself? If not maybe extending getHTML() function to perform trimming could also work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions