Specify what the line break converter should do and rewrite it in DOM

Created on 14 December 2009, over 15 years ago
Updated 18 May 2025, 20 days ago

The line break converter is a shame we inherited from Wordpress. It is full of bugs, nobody really groks the implementation and it tries to parse HTML using regexps.

We need to rewrite this using proper DOM manipulations, like we refactored the HTML corrector.

But... what should this line break converter do exactly? This looks a bit like black-magic currently. Somehow, the line break converter should:

  1. Convert chunk of text separated by empty lines (\n\n) into HTML paragraphs (<p></p>)
  2. Retain text-level HTML tags in the chunk of text
  3. Ignore the content of some HTML tags (script, style, object, pre, ... maybe others)

But I'm not sure:

  • What to do with tables? We probably should only convert paragraphs into <td>s, not inside other elements... by the way, do we want to add <p> to mostly all <td>s?
  • What to do with <div>s?
  • ...
πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

filter.module

Created by

πŸ‡«πŸ‡·France Damien Tournoud

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024