Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!8677
Resolve
#3428652
"Do not use replace pattern"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Resolve
#3428652
"Do not use replace pattern"
issue/drupal-3428652:3428652-do-not-use-replace_pattern
into
11.x
Overview
5
Commits
10
Pipelines
10
Changes
4
All threads resolved!
Show all comments
Closed
Théodore Biadala
requested to merge
issue/drupal-3428652:3428652-do-not-use-replace_pattern
into
11.x
11 months ago
Overview
5
Commits
10
Pipelines
10
Changes
4
All threads resolved!
Show all comments
Expand
Closes
#3428652
0
0
Merge request reports
Compare
11.x
version 9
f4544277
9 months ago
version 8
cce63d25
9 months ago
version 7
be2dcbbc
9 months ago
version 6
489d1645
9 months ago
version 5
90a1a55d
9 months ago
version 4
298de023
9 months ago
version 3
51e1a138
9 months ago
version 2
638e6bdf
11 months ago
version 1
6088e99f
11 months ago
11.x (base)
and
latest version
latest version
9ce43a7a
10 commits,
9 months ago
version 9
f4544277
9 commits,
9 months ago
version 8
cce63d25
8 commits,
9 months ago
version 7
be2dcbbc
7 commits,
9 months ago
version 6
489d1645
6 commits,
9 months ago
version 5
90a1a55d
5 commits,
9 months ago
version 4
298de023
4 commits,
9 months ago
version 3
51e1a138
3 commits,
9 months ago
version 2
638e6bdf
2 commits,
11 months ago
version 1
6088e99f
1 commit,
11 months ago
4 files
+
56
−
47
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
core/misc/machine-name.js
+
7
−
11
Options
@@ -5,7 +5,7 @@
@@ -5,7 +5,7 @@
* @internal
* @internal
*/
*/
(
function
(
$
,
Drupal
,
drupalSettings
,
slugif
y
)
{
(
function
(
$
,
Drupal
,
drupalSettings
,
transliterateLibrar
y
)
{
/**
/**
* Trims string by a character.
* Trims string by a character.
*
*
@@ -294,21 +294,17 @@
@@ -294,21 +294,17 @@
drupalSettings
.
transliteration_language_overrides
[
drupalSettings
.
transliteration_language_overrides
[
drupalSettings
.
langcode
drupalSettings
.
langcode
];
];
const
normalizedLanguageOverrides
=
{};
const
replace
=
{};
if
(
languageOverrides
)
{
if
(
languageOverrides
)
{
Object
.
keys
(
languageOverrides
).
forEach
((
key
)
=>
{
Object
.
keys
(
languageOverrides
).
forEach
((
key
)
=>
{
// Updates the keys from hexadecimal to strings.
// Updates the keys from hexadecimal to strings.
normalizedLanguageOverrides
[
String
.
fromCharCode
(
key
)]
=
replace
[
String
.
fromCharCode
(
key
)]
=
languageOverrides
[
key
];
languageOverrides
[
key
];
});
});
}
}
slugify
.
config
({
separator
:
settings
.
replace
,
allowedChars
:
settings
.
replace_pattern
,
replace
:
normalizedLanguageOverrides
,
});
return
prepareMachineName
(
slugify
(
source
),
settings
);
const
transliteratedSource
=
transliterateLibrary
(
source
,
{
replace
});
return
prepareMachineName
(
transliteratedSource
,
settings
);
},
},
};
};
})(
jQuery
,
Drupal
,
drupalSettings
,
slugify
);
})(
jQuery
,
Drupal
,
drupalSettings
,
transliterate
);
Loading