Follow-up to #2616880: Port html_title to D8

# Summary

Drupal node titles are restrictive and do not support italicized text or superscript text (e.g., Book titles, trademark symbols). The HTML Title module allows a limited set of HTML markup (em, sub, sup, b, i, strong, cite, code, bdi, wbr) to be used in node titles. It filters all other markup from titles to prevent XSS vulnerabilities or irrational nesting (e.g., links within links).

# Project URL

https://www.drupal.org/project/html_title

# Where is the code?

https://github.com/mohit-rocks/html_title
More stable : https://github.com/ciandt-china-dev/html_title

# Estimated completion date

# Dependencies

Unknown

# Who's doing the port?

https://www.drupal.org/user/639098/

# What help do they need?

Unknown

# D8 roadmap

At first port basic functionality provided by D7 module.

# Background and reference information

Unknown

Comments

mohit_aghera created an issue. See original summary.

mohit_aghera’s picture

Issue summary: View changes
mohit_aghera’s picture

Issue summary: View changes
mohit_aghera’s picture

Issue summary: View changes
mohit_aghera’s picture

Issue summary: View changes
mohit_aghera’s picture

Issue summary: View changes
mohit_aghera’s picture

Issue summary: View changes
mohit_aghera’s picture

Status: Active » Needs review

Almost all the basic features provided in Drupal 7 version are working fine.

reekris’s picture

@mohit_aghera I'm looking for this functionaltiy for Drupal 8. What is the status of the code at github? Is it ready for an initial 8 version on drupal.org?

mohit_aghera’s picture

@reekris It's pretty much stable with drupal 8 release. You can try it out. Let me know if you find any issues, i will try to fix it.

balawang’s picture

Issue tags: +#ciandt-contrib
Related issues: +#2616880: Port html_title to D8

@mohit_aghera,

we have installed your branch and did some comparison to the version we ported. There are few differences, especially for your branch HtmlTitleFormatter is new from D7.

Besides, we've got few ideas for us to discuss with your branch which are new or different from D7 version:
1. New HTMLTitleFormatter added, we have to edit the system Content list views to change Content Title to HTML Title format, otherwise, the html tags show up in content list. Apply to all title using html title, it was automatically transformed in D7.
2. If it's good to have HTML Title as format for the other string field, which we think it should focus on Title.

You may also instlal and review @sean_cit's code at github https://github.com/ciandt-china-dev/html_title. Then, we will be happy to discuss how to merge our code.

Regards,

mohit_aghera’s picture

@balawang
Sure, we can discuss it and merge it to single module. That will be much better.

echoz’s picture

Drupal 8.1.8

Installed the version at https://github.com/mohit-rocks/html_title and it broke the site with:
Warning: array_unique() expects parameter 1 to be array, null given in html_title_preprocess_page_title() (line 40 of PATH_TO_modules/html_title/html_title.module).

Installed the version at https://github.com/ciandt-china-dev/html_title from #11 and it seems to be working fine.

Can we please have a official dev version?

echoz’s picture

@balawang the version from the github link in #11 as I wrote does work, but (even after first removing the html in all Titles) the uninstall wants to delete blocks and custom views (even those whos content did not ever use html title)!

echoz’s picture

Still wanting help to completely remove the @sean_cit html_title module. It has references to html_title in the serialized data of all the views in the config table. It's listed as a dependency module in every view. Can anyone suggest a MySQL command to remove?

ker688@gmail.com’s picture

Hi mohit_aghera,

Do you believe it's good to create a D8 branch now

we use the source code which balawang mentioned, we also fixed some issues, I think it's better to have D8 branch now.

what do you think ?

Thanks.

lamp5’s picture

Hi.
#11 work well on D8.3 :)

mohit_aghera’s picture

Issue summary: View changes
ericpugh’s picture

Thanks for your work, everyone! Would it be possible to get the "most stable" version as an 8.x-dev release?

markhalliwell’s picture

Dakwamine’s picture

The purpose of those modules is the same: adding html markup to the title. Here are some noticeable differences about their design:

  • html_titles does not have a tag whitelist nor XSS filtering. Not secure.
  • html_titles has some use cases unsupported such as node rendering in views or in other displays (an issue seems to have a patch which could fix that).
  • html_titles has no special handling for "rss" feeds.
  • html_titles requires an additional template which overrides the node title field.
markhalliwell’s picture

I'm aware of the differences, I was just asking if that module should be marked as a duplicate of this one. It's confusing to have competing modules with the same name.

Dakwamine’s picture

Oh, ok, sorry. It is indeed confusing to have those two modules with a very similar name and purpose. I don't have the power to mark a module as duplicate though.

edit: and if someone has to mark it as duplicate, maybe we should try to get a stable, or at least, "official" release on the html_title module page before. ^^'

mmjvb’s picture

Status: Needs review » Needs work

No branch on d.o, set back to Needs work.

Dakwamine’s picture

Can we get this module on the drupal.org repository so we can start reviews and report issues?

kevinc_’s picture

Does it have to be @generalredneck who creates the new branch as he was the original creator?

I'd really value this being managed under DO to be able to raise issues and track changes.

smithkr’s picture

I'm looking for this functionality for Drupal 8...has there been any movement towards an initial 8 version on drupal.org?

Thanks!

mohit_aghera’s picture

@smithkr
https://github.com/ciandt-china-dev/html_title this implementation is working fine.
You can use this for now, till we don't sort out port on this repository itself.

mohit_aghera’s picture

Issue summary: View changes
smithkr’s picture

@mohit_aghera Thanks!

generalredneck’s picture

I wanted to point out that the original maintainers nor I posted this, and there isn't an issue in the html_title issue queue, so until Mohit hit me up directly I was unaware that this was even a thing. So, First I've done a code review and found both examples lacking and encourage you all to hold off on installing this functionality until it gets to D.O. Mohit and myself are working together to come up with a solution that is satisfactory. I've sent an email to ciandt as well but @balawang, maybe you would want to join in specifically. Feel free to DM me on slack.

generalredneck’s picture

Wanna throw out there that there was indeed an issue that was closed after I went looking for it. see #2616880: Port html_title to D8. However, it was before I took maintainership of the module so I missed all the closed tasks. We will work on this to do what we can. I'm sorry for my ignorance.

weynhamz’s picture

@generalredneck, I am taking care of the CI&T's 8.x port now, PR for the fix you addressed in the email has been created, https://github.com/ciandt-china-dev/drupal-module-html_title/pull/4, re-applied ur fix for 7.x version, please review and I will merge it to the master.

Daniel Korte’s picture

Thanks for everyone's work on this. I cleaned up the 8.x port a bit and made a pull request on GitHub here:

Add support for smart quotes, fix broken HTML, add Configure link to modules page, and replace 'Html' with 'HTML'
https://github.com/ciandt-china-dev/drupal-module-html_title/pull/5

Patch file:
https://patch-diff.githubusercontent.com/raw/ciandt-china-dev/drupal-mod...

smithkr’s picture

Hi there,

Is the update in #34 suitable for use?

Thanks!

smithkr’s picture

Hi there,

I hope this is the right place for this question, since it's related to the Drupal 8 port, but I've found an issue with HTML tags being rendered in search results. Details are here: https://www.drupal.org/project/html_title/issues/3082047

Hope this helps.

mmjvb’s picture

No, this is not the right place for that question. You already placed the issue at the right place, the queue of the project itself. Unfortunately, you needed to assign it to 7.x, there is still no 8.x available! Your alternative is to raise the issue at github. Suggest to mention whether you applied pull/5.

When this issue would have contained a proper roadmap, your issue could have been mentioned there. Assuming it would fit in one of the milestones. As there is no roadmap, any issue about 8.x should be filed with the project itself.

The purpose of this issue is to communicate the status of the port.

smithkr’s picture

@mmjvb Thanks––I've posted the issue on github.

generalredneck’s picture

Status: Needs work » Reviewed & tested by the community

Ok swung back around this way. I've released the 8.x-1.0-rc1 version given that I've had this work successfully on my own projects as well as many of you have. I want to give a big shout out to the CI&T China Developers developers and will be giving each person who committed work an attribution here on D.O to make sure that it's fair.

As for the rules of this post, since it's about the port to d8, I'm marking it as reviewed and tested and we can port the other issues that have come up in here over to the issue queue. (example smithkr's above).

JeroenT’s picture

Status: Reviewed & tested by the community » Fixed

Tagged 8.x-1.0.

JeroenT’s picture

Assigned: mohit_aghera » Unassigned
apaderno’s picture

I am giving credits to the users who participated in this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.