|
@@ -44,6 +44,7 @@ export default {
|
|
` data-uuid="${this.uuid}"` +
|
|
` data-uuid="${this.uuid}"` +
|
|
`>${this.tei}</div>`
|
|
`>${this.tei}</div>`
|
|
this.parseLinks()
|
|
this.parseLinks()
|
|
|
|
+ this.parsePageBreaks()
|
|
// console.log('EdText: builded html', this.html)
|
|
// console.log('EdText: builded html', this.html)
|
|
},
|
|
},
|
|
parseLinks () {
|
|
parseLinks () {
|
|
@@ -82,6 +83,29 @@ export default {
|
|
// console.log('this.html', this.html)
|
|
// console.log('this.html', this.html)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ parsePageBreaks () {
|
|
|
|
+ let pbs = this.html.match(/<span role="pageBreak"[^>]+><\/span>/g)
|
|
|
|
+ console.log('pagebreaks', pbs)
|
|
|
|
+ if (pbs) {
|
|
|
|
+ let pbparts, newpb, num
|
|
|
|
+ for (var i = 0; i < pbs.length; i++) {
|
|
|
|
+ pbparts = RegExp(/<span role="pageBreak" data-num="(.+)"><\/span>/).exec(pbs[i], 'g')
|
|
|
|
+ if (!pbparts) {
|
|
|
|
+ console.warn(`pageBreak ${i} maformed`, pbs[i])
|
|
|
|
+ } else {
|
|
|
|
+ console.log('pbparts', pbparts)
|
|
|
|
+ num = pbparts[1]
|
|
|
|
+ newpb = `<span` +
|
|
|
|
+ ` role="pageBreak"` +
|
|
|
|
+ ` data-num="${num}"` +
|
|
|
|
+ ` data-num-prev="${num - 1}"` +
|
|
|
|
+ ` />`
|
|
|
|
+ console.log('newpb', newpb)
|
|
|
|
+ this.html = this.html.replace(pbs[i], newpb)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
onClickRef (e) {
|
|
onClickRef (e) {
|
|
console.log('onClickRef(e)', e)
|
|
console.log('onClickRef(e)', e)
|
|
this.$router.push({
|
|
this.$router.push({
|