MCPcopy Index your code
hub / github.com/gto76/python-cheatsheet / preventPageBreaks

Function preventPageBreaks

parse.js:865–876  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

863}
864
865function 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
878function fixPageBreaksFile() {
879 const modesDiv = $('#file').parent().parent().parent()

Callers 1

highlightCodeFunction · 0.85

Calls 1

$Function · 0.85

Tested by

no test coverage detected