expensify-common 2.0.34 → 2.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ExpensiMark.js +4 -4
- package/package.json +1 -1
package/dist/ExpensiMark.js
CHANGED
|
@@ -67,20 +67,20 @@ class ExpensiMark {
|
|
|
67
67
|
{
|
|
68
68
|
name: 'codeFence',
|
|
69
69
|
// ` is a backtick symbol we are matching on three of them before then after a new line character
|
|
70
|
-
regex: /(```(
|
|
70
|
+
regex: /(```(\r\n|\n))((?:\s*?(?!(?:\r\n|\n)?```(?!`))[\S])+\s*?(?:\r\n|\n))(```)/g,
|
|
71
71
|
// We're using a function here to perform an additional replace on the content
|
|
72
72
|
// inside the backticks because Android is not able to use <pre> tags and does
|
|
73
73
|
// not respect whitespace characters at all like HTML does. We do not want to mess
|
|
74
74
|
// with the new lines here since they need to be converted into <br>. And we don't
|
|
75
75
|
// want to do this anywhere else since that would break HTML.
|
|
76
76
|
// will create styling issues so use  
|
|
77
|
-
replacement: (_extras, _match, _g1, textWithinFences) => {
|
|
77
|
+
replacement: (_extras, _match, _g1, _g2, textWithinFences) => {
|
|
78
78
|
const group = textWithinFences.replace(/(?:(?![\n\r])\s)/g, ' ');
|
|
79
79
|
return `<pre>${group}</pre>`;
|
|
80
80
|
},
|
|
81
|
-
rawInputReplacement: (_extras, _match, _g1, textWithinFences) => {
|
|
81
|
+
rawInputReplacement: (_extras, _match, _g1, newLineCharacter, textWithinFences) => {
|
|
82
82
|
const group = textWithinFences.replace(/(?:(?![\n\r])\s)/g, ' ').replace(/<emoji>|<\/emoji>/g, '');
|
|
83
|
-
return `<pre>${group}</pre>`;
|
|
83
|
+
return `<pre>${newLineCharacter}${group}</pre>`;
|
|
84
84
|
},
|
|
85
85
|
},
|
|
86
86
|
/**
|