()
| 863 | } |
| 864 | |
| 865 | function preventPageBreaks() { |
| 866 | $(':header').each(function(index) { |
| 867 | var el = $(this) |
| 868 | var untilPre = el.nextUntil('pre') |
| 869 | var untilH2 = el.nextUntil('h2') |
| 870 | if ((untilPre.length < untilH2.length) || el.prop('tagName') === 'H1') { |
| 871 | untilPre.add(el).next().add(el).wrapAll("<div></div>"); |
| 872 | } else { |
| 873 | untilH2.add(el).wrapAll("<div></div>"); |
| 874 | } |
| 875 | }); |
| 876 | } |
| 877 | |
| 878 | function fixPageBreaksFile() { |
| 879 | const modesDiv = $('#file').parent().parent().parent() |