passing test
This commit is contained in:
parent
162d7e7cbb
commit
2ce1eb44bd
@ -299,7 +299,7 @@ const elseMarker = '{:else}'
|
||||
const closingIfMarker = '{/if}'
|
||||
|
||||
const eachStartMarkerRegex = /{#each\s+([^}]+?)\s+as\s+([^}]+?)\s*}/;
|
||||
const eachClosingBlockMarker = '{/each}'
|
||||
const eachClosingMarker = '{/each}'
|
||||
|
||||
|
||||
|
||||
@ -366,7 +366,7 @@ function fillTemplatedOdtElement(rootElement, compartment) {
|
||||
/**
|
||||
* Looking for {/each}
|
||||
*/
|
||||
const isEachClosingBlock = text.includes(eachClosingBlockMarker)
|
||||
const isEachClosingBlock = text.includes(eachClosingMarker)
|
||||
|
||||
if(isEachClosingBlock) {
|
||||
|
||||
@ -836,9 +836,11 @@ function fillTemplatedOdtDocument(document, compartment) {
|
||||
...findAllMatches(fullText, elseMarker),
|
||||
...findAllMatches(fullText, closingIfMarker),
|
||||
...findAllMatches(fullText, eachStartMarkerRegex),
|
||||
...findAllMatches(fullText, eachClosingBlockMarker)
|
||||
...findAllMatches(fullText, eachClosingMarker)
|
||||
];
|
||||
|
||||
console.log('positionedMarkers', positionedMarkers)
|
||||
|
||||
// If no markers found, skip this container
|
||||
if(positionedMarkers.length >= 1) {
|
||||
|
||||
@ -995,7 +997,7 @@ function fillTemplatedOdtDocument(document, compartment) {
|
||||
let matchIndex;
|
||||
|
||||
// looking for a block marker
|
||||
for(const marker of [ifStartMarkerRegex, elseMarker, closingIfMarker, eachStartMarkerRegex, eachClosingBlockMarker]) {
|
||||
for(const marker of [ifStartMarkerRegex, elseMarker, closingIfMarker, eachStartMarkerRegex, eachClosingMarker]) {
|
||||
if(typeof marker === 'string') {
|
||||
const index = remainingText.indexOf(marker)
|
||||
|
||||
|
||||
BIN
tests/fixtures/liste-nombres-avec-formattage.odt
vendored
BIN
tests/fixtures/liste-nombres-avec-formattage.odt
vendored
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user