// transformer les balises [...] en
si ça correspond aux classes prédéfinies if (debug) console.log('start tagToClass'); (function() { let baliseWords = [ 'labeur', 'free', 'temps', 'moment', 'pilote', 'free_left', 'citation', 'latour', 'latour_nohead', 'lampe', 'lampe_nohead', 'note', 'bibliographie', 'imgsmall', 'imgsmallsmall', 'imgsmall_bottom', 'fullpage2imgs', 'fullpageimage', 'tripleimgs', 'tripleimgs_bottom', 'tripleimgs2', 'tripleimgs2_bottom', 'bottomimg', 'imgfullspreadleft', 'imgfullspreadright', 'imgfullspreadright_bleedtop', 'imgfullspreadright_bleed', 'breakbefore', 'breakafter', `doublepage_bigright`, `doublepage_bigleft`, `screenshot`, ]; let bodyContent = $('#body').html(); bodyContent = bodyContent.replace(/\[([^\/\]]+)\]/g, function(match, word) { if (baliseWords.includes(word)) { return word === 'note' ? `` : `
`; } else { return match; } }).replace(/\[\/([^\]]+)\]/g, function(match, word) { if (baliseWords.includes(word)) { return word === 'note' ? '' : '
'; } else { return match; } }); $('#body').empty().append(bodyContent); })(); if (debug) console.log('end tagToClass');