@@ -291,12 +291,15 @@ module.exports = {
291291 // ONE punctuation character normally forbidden in slugs may
292292 // optionally be permitted by specifying it via options.allow.
293293 // The separator may be changed via options.separator.
294- // By default, accents are preserved. To strip accents,
295- // set options. stripAccents to true .
294+ // By default, the i18n.options.stripUrlAccents option is honored;
295+ // having stripAccents passed as an option takes precedence .
296296 slugify ( s , options ) {
297297 const { stripAccents, ...opts } = options || { } ;
298298 const slug = require ( 'sluggo' ) ( s , opts ) ;
299- if ( stripAccents ) {
299+ const shouldStripAccents = ( typeof stripAccents !== 'undefined' )
300+ ? stripAccents
301+ : self . apos . i18n . options . stripUrlAccents ;
302+ if ( shouldStripAccents ) {
300303 return _ . deburr ( slug ) ;
301304 }
302305 return slug ;
@@ -945,8 +948,8 @@ module.exports = {
945948 // ONE punctuation character normally forbidden in slugs may
946949 // optionally be permitted by specifying it via options.allow.
947950 // The separator may be changed via options.separator.
948- // By default, accents are preserved. To strip accents,
949- // set options. stripAccents to true .
951+ // By default, the i18n.options.stripUrlAccents option is honored;
952+ // having stripAccents passed as an option takes precedence .
950953 slugify : function ( string , options ) {
951954 return self . slugify ( string , options ) ;
952955 } ,
0 commit comments