mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Update marky-markdown wrapping fix.
This commit is contained in:
@@ -33,10 +33,16 @@ function build(type) {
|
|||||||
$a.replaceWith($a.html());
|
$a.replaceWith($a.html());
|
||||||
});
|
});
|
||||||
|
|
||||||
// Fix marky-markdown wrapping of sibling anchors.
|
// Fix marky-markdown wrapping around headers.
|
||||||
$('h3 ~ a').each(function() {
|
$('p:empty + h3').prev().remove();
|
||||||
var $a = $(this);
|
|
||||||
$a.nextAll('p').first().append($a);
|
$('h3 ~ p:empty').each(function() {
|
||||||
|
var $p = $(this),
|
||||||
|
node = this.previousSibling;
|
||||||
|
|
||||||
|
while ((node = node.previousSibling) && node.name != 'h3' && node.name != 'p') {
|
||||||
|
$p.prepend(node.nextSibling);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Append YAML front matter.
|
// Append YAML front matter.
|
||||||
|
|||||||
Reference in New Issue
Block a user