mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 16:30:12 +00:00
Contract multiple underbars in a row in refnames to a single underbar
* Inlcudes test coverage for refnames with single and more than one underbar in a row which are maintained as separate keys but serialized without the multiple underbars Bug: T267974 Change-Id: I9c21a6ff761f4b9a22b1185280b5676e2c160208
This commit is contained in:
parent
6ebe050750
commit
c3bc1f00b0
|
@ -115,6 +115,7 @@ class ReferencesData {
|
|||
// FIXME: normalizeKey in core performs a few more operations on $refName,
|
||||
// which will be addressed in a follow up
|
||||
$refNameSanitized = Sanitizer::escapeIdForAttribute( $refName );
|
||||
$refNameSanitized = preg_replace( '/__+/', '_', $refNameSanitized );
|
||||
|
||||
$refIdBase = 'cite_ref-' . ( $hasRefName ? $refNameSanitized . '_' . $refKey : $refKey );
|
||||
$noteId = 'cite_note-' . ( $hasRefName ? $refNameSanitized . '-' . $refKey : $refKey );
|
||||
|
|
Loading…
Reference in a new issue