I just wondered if it wouldn't be better to use MailFormatHelper::htmlToText which comes with Drupal. Or is there some feature of Html2Text that we really need?

Comments

hansfn created an issue. See original summary.

joelpittet’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
Priority: Minor » Normal

I am curious on this as well as I notice Html2Text is using semver(from what I can tell) and 1.2.0 is out so it might be a good time to cut ties with a 2.x release?

webflo’s picture

@joelpittet We are already using Html2Text 4.2.1.

I have no opinion on MailFormatHelper::htmlToText vs. Html2Text. But i do know they produce different outputs. So technically this is BC break.

joelpittet’s picture

I guess if it's an option (barring any proof of improvement) we could put it in as a setting to avoid the BC break?

frederickjh’s picture

@webflo the current recommend version on the project page 8.x-1.0-beta2 is using Html2Text 4.0.1. In fact when I look at the composer.json at the tip of the 1.x and the 2.x branches both have in the require section:
"html2text/html2text": "~4.0.1",

nicholasthompson’s picture

https://git.drupalcode.org/project/swiftmailer/blob/8.x-1.x/composer.jso...

This is too strict and causes conflict with distributions such as Thunder.

  Problem 1
    - Installation request for drupal/swiftmailer 1.x-dev -> satisfiable by drupal/swiftmailer[1.x-dev].
    - drupal/swiftmailer 1.x-dev requires html2text/html2text ~4.0.1 -> satisfiable by html2text/html2text[4.0.1] but these conflict with your requirements or minimum-stability.
geek-merlin’s picture

Title: Drop dependency on Html2Text » Add setting to choose between Html2Text and MailFormatHelper::htmlToText
Category: Task » Feature request
Status: Active » Closed (outdated)
Related issues: +#3121286: Use semver for all dependencies

Opened #3121286: Use semver for all dependencies for #6.

Closing this for now as noone voiced a reason for this. Feel free to reopen if needed.

adamps’s picture

This issue got muddled. There is some discussion about which version of Html2Text to use. Then #6 talks about how to write the version number.

If anyone wants to continue to discuss the original question then please join #3126935: Improvements to plaintext conversion