Updated: Comment #0

Problem/Motivation

File common.inc has three legacy global functions which handle validating or "cleaning" of HTML identifiers. These are drupal_clean_css_identifier, drupal_html_class and drupal_html_id. Global legacy functions are bad.

Proposed resolution

Create a service html.identifier with methods validate and validateUnique.

Remaining tasks

TODO

User interface changes

None.

API changes

  • Functions drupal_clean_css_identifier, drupal_html_class and drupal_html_id are marked as deprecated.
  • Service with methods validate and validateUnique is added.

Comments

jiv_e’s picture

Issue summary: View changes
jiv_e’s picture

This issue was introduced to me by dawehner. This is my first real contribution to Drupal 8 code so bare with me. I also try to practise test driven development as I go.

jiv_e’s picture

Title: Replace 3 HTML functions in common.inc with html.indentifier service » Replace 3 HTML related functions in common.inc with html.indentifier service
dawehner’s picture

Thanks for working on that.

larowlan’s picture

Pretty sure there is already an open issue for this

jiv_e’s picture

I couldn't find one. Please, let me know if you find it!

larowlan’s picture

jiv_e’s picture

Thanks! Broken issue search was a limiting factor. I found this also with Google.

jiv_e’s picture

Status: Active » Closed (duplicate)