- πΊπΈUnited States mark_fullmer Tucson
Unless there is a reason that the original suggestion of transliteration wouldn't work, I think that would be preferable over using an ID based on an arbitrary machine id plus the delta. Although the machine ID would ensure uniqueness, it no longer preserves anything about the content of the tab header. This would be valuable if someone were wanting to deep link via anchor link to a specific Bootstrap tab, as described in https://webdesign.tutsplus.com/tutorials/how-to-add-deep-linking-to-the-...
The following transliteration approach, modeled on core, appears to work fine, and will ensure that existing sites with content will not see any change to their IDs on tabs:
+ // Transliterate the header (#3293143) following Drupal core's + // approach in migrate/process/MachineName.php + $transformed = \Drupal::transliteration()->transliterate($item->header, LanguageInterface::LA NGCODE_DEFAULT); + $item_header_text = preg_replace('/[^a-z0-9_]+/', '_', strtolower($transformed));
The attached patch also adds test coverage for transliteration.
- Issue was unassigned.
- Assigned to mmarler
- last update
over 1 year ago 1 pass - πΊπΈUnited States mark_fullmer Tucson
Testing with a colleague, we reviewed the change and had further clarification that non-Latin characters cannot be present in HTML ids, so the transliteration to Latin characters is the next best option.
Adding test coverage for Chinese.
- Status changed to RTBC
over 1 year ago 8:57pm 26 May 2023 - πΊπΈUnited States ricksta
I have reviewed the patch in #12 π No support for non-Latin characters (such as Cyrillic) Fixed in both Drupal 9 and 10 and can confirm it works fine.
-
ricksta β
committed 9e100d4c on 2.x
Issue #3293143 by mark_fullmer, mmarler, kolotunbobo, ricksta: No...
-
ricksta β
committed 9e100d4c on 2.x
- Status changed to Fixed
over 1 year ago 9:16pm 26 May 2023 Automatically closed - issue fixed for 2 weeks with no activity.