We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d1e195 commit 11c6c82Copy full SHA for 11c6c82
1 file changed
ts/core/MmlTree/SerializedMmlVisitor.ts
@@ -161,7 +161,17 @@ export class SerializedMmlVisitor extends MmlVisitor {
161
.replace(/</g, '<')
162
.replace(/>/g, '>')
163
.replace(/"/g, '"')
164
- .replace(/[\uD800-\uDBFF]./g, toEntity)
165
- .replace(/[\u0080-\uD7FF\uE000-\uFFFF]/g, toEntity);
+ .replace(/[\uD800-\uDBFF]./g, this.toEntity)
+ .replace(/[\u0080-\uD7FF\uE000-\uFFFF]/g, this.toEntity);
166
+ }
167
+
168
+ /**
169
+ * Access to the toEntity() function that can be overridden in subclasses.
170
+ *
171
+ * @param {string} c The character to encode.
172
+ * @returns {string} The numeric entity for the character.
173
+ */
174
+ protected toEntity(c: string): string {
175
+ return toEntity(c);
176
}
177
0 commit comments