Skip to content

Commit

Permalink
fix wbr in the middle of =
Browse files Browse the repository at this point in the history
  • Loading branch information
rinick authored and Gerrit0 committed Nov 23, 2019
1 parent fe2363c commit 652bf4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/output/helpers/wbr.ts
Expand Up @@ -12,6 +12,8 @@ export function wbr(options: any): Handlebars.SafeString {
let str = typeof options === 'string' ? options : options.fn(this);
str = Handlebars.escapeExpression(str);

str = str.replace(/&#x3D;/g, '&#61;'); // because 3D would be converted to 3<wbr>D, use decimal format instead

str = str.replace(/([^_\-][_\-])([^_\-])/g, (m: string, a: string, b: string) => a + '<wbr>' + b);
str = str.replace(/([^A-Z])([A-Z][^A-Z])/g, (m: string, a: string, b: string) => a + '<wbr>' + b);

Expand Down

0 comments on commit 652bf4f

Please sign in to comment.