feat:修复匹配问题
This commit is contained in:
@@ -568,7 +568,10 @@ async function detectVariablesFromBuffer(buffer) {
|
|||||||
const allVariables = new Set()
|
const allVariables = new Set()
|
||||||
xmlFileNames.forEach((name) => {
|
xmlFileNames.forEach((name) => {
|
||||||
const xmlText = zip.files[name].asText()
|
const xmlText = zip.files[name].asText()
|
||||||
extractVariablesFromText(xmlText).forEach((item) => allVariables.add(item))
|
const plainText = (xmlText.match(/<w:t[^>]*>([^<]*)<\/w:t>/g) || [])
|
||||||
|
.map((t) => t.replace(/<[^>]+>/g, ''))
|
||||||
|
.join('')
|
||||||
|
extractVariablesFromText(plainText).forEach((item) => allVariables.add(item))
|
||||||
})
|
})
|
||||||
|
|
||||||
mergeDetectedVariables([...allVariables])
|
mergeDetectedVariables([...allVariables])
|
||||||
|
|||||||
Reference in New Issue
Block a user