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
Comment #1
jiv_e commentedComment #2
jiv_e commentedThis 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.
Comment #3
jiv_e commentedComment #4
dawehnerThanks for working on that.
Comment #5
larowlanPretty sure there is already an open issue for this
Comment #6
jiv_e commentedI couldn't find one. Please, let me know if you find it!
Comment #7
larowlan#2121713: Move drupal_html_id() and drupal_html_class() to Drupal\Component\Utility
Comment #8
larowlanAnd #2082103: Convert drupal_clean_css_identifier() to a component which was merged into #2121713: Move drupal_html_id() and drupal_html_class() to Drupal\Component\Utility
Comment #9
jiv_e commentedThanks! Broken issue search was a limiting factor. I found this also with Google.
Comment #10
jiv_e commented