Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Reset section stack for the next document #1114

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ final class SectionCreationTransformer implements NodeTransformer

public function enterNode(Node $node, CompilerContextInterface $compilerContext): Node
{
if ($node instanceof DocumentNode) {
$this->sectionStack = [];
}

if (!$compilerContext->getShadowTree()->getParent()?->getNode() instanceof DocumentNode) {
return $node;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<title>Another Page - Bootstrap Theme</title>
<title>Another Page</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand All @@ -19,22 +19,7 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">

<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a href="/anotherPage.html" class="nav-link current active" aria-current="page">
Another Page
</a>
</li><li class="nav-item">
<a href="/somePage.html" class="nav-link">
Some Page
</a>
</li><li class="nav-item">
<a href="/yetAnotherPage.html" class="nav-link">
Yet Another Page
</a>
</li></ul>


</div>
</div>
</nav>
Expand All @@ -44,35 +29,18 @@
<div class="container">
<div class="row">
<div class="col-lg-3">
<nav class="nav flex-column">
<ul class="menu-level-main">
<li>
<a href="/anotherPage.html"
class="nav-link current active" aria-current="page">Another Page</a>
</li>
<li>
<a href="/somePage.html"
class="nav-link">Some Page</a>
</li>
<li>
<a href="/yetAnotherPage.html"
class="nav-link">Yet Another Page</a>
</li>
</ul>
</nav>


</div>
<div class="col-lg-9">

<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/index.html">Document Title</a></li>
<li class="breadcrumb-item"><a href="/anotherPage.html">Another Page</a></li>
<li class="breadcrumb-item"><a href="index.html">Document Title</a></li>
<li class="breadcrumb-item"><a href="#">Another Page</a></li>
</ol>
</nav>
<!-- content start -->

<div class="section" id="another-page">
<div class="section" id="another-page">
<h1>Another Page</h1>

<p>Lorem Ipsum Dolor.</p>
Expand All @@ -84,14 +52,7 @@ <h1>Another Page</h1>
</div>
</div>
</main>
<footer class="bg-primary text-light">
<div class="container">

<p>Generated by <a href="https://www.phpdoc.org/">phpDocumentor</a>.</p>

</div>
</footer>


<!-- Optional JavaScript; choose one of the two! -->

<!-- Option 1: Bootstrap Bundle with Popper -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<title>Document Title - Bootstrap Theme</title>
<title>Document Title</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand All @@ -19,22 +19,7 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">

<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a href="/anotherPage.html" class="nav-link">
Another Page
</a>
</li><li class="nav-item">
<a href="/somePage.html" class="nav-link">
Some Page
</a>
</li><li class="nav-item">
<a href="/yetAnotherPage.html" class="nav-link">
Yet Another Page
</a>
</li></ul>


</div>
</div>
</nav>
Expand All @@ -44,54 +29,29 @@
<div class="container">
<div class="row">
<div class="col-lg-3">
<nav class="nav flex-column">
<ul class="menu-level-main">
<li>
<a href="/anotherPage.html"
class="nav-link">Another Page</a>
</li>
<li>
<a href="/somePage.html"
class="nav-link">Some Page</a>
</li>
<li>
<a href="/yetAnotherPage.html"
class="nav-link">Yet Another Page</a>
</li>
</ul>
</nav>


</div>
<div class="col-lg-9">

<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/index.html">Document Title</a></li>
<li class="breadcrumb-item"><a href="#">Document Title</a></li>
</ol>
</nav>
<!-- content start -->

<div class="section" id="document-title">
<div class="section" id="document-title">
<h1>Document Title</h1>

<p>Lorem Ipsum Dolor.</p>


</div>
<!-- content end -->
</div>
</div>
</div>
</div>
</main>
<footer class="bg-primary text-light">
<div class="container">

<p>Generated by <a href="https://www.phpdoc.org/">phpDocumentor</a>.</p>

</div>
</footer>


<!-- Optional JavaScript; choose one of the two! -->

<!-- Option 1: Bootstrap Bundle with Popper -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<title>Some Page - Bootstrap Theme</title>
<title>Some Page</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand All @@ -19,22 +19,7 @@
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">

<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a href="/anotherPage.html" class="nav-link">
Another Page
</a>
</li><li class="nav-item">
<a href="/somePage.html" class="nav-link current active" aria-current="page">
Some Page
</a>
</li><li class="nav-item">
<a href="/yetAnotherPage.html" class="nav-link">
Yet Another Page
</a>
</li></ul>


</div>
</div>
</nav>
Expand All @@ -44,38 +29,21 @@
<div class="container">
<div class="row">
<div class="col-lg-3">
<nav class="nav flex-column">
<ul class="menu-level-main">
<li>
<a href="/anotherPage.html"
class="nav-link">Another Page</a>
</li>
<li>
<a href="/somePage.html"
class="nav-link current active" aria-current="page">Some Page</a>
</li>
<li>
<a href="/yetAnotherPage.html"
class="nav-link">Yet Another Page</a>
</li>
</ul>
</nav>


</div>
<div class="col-lg-9">

<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/index.html">Document Title</a></li>
<li class="breadcrumb-item"><a href="/somePage.html">Some Page</a></li>
<li class="breadcrumb-item"><a href="index.html">Document Title</a></li>
<li class="breadcrumb-item"><a href="#">Some Page</a></li>
</ol>
</nav>
<!-- content start -->

<div class="section" id="some-page">
<div class="section" id="some-page">
<h1>Some Page</h1>

<p>Lorem Ipsum <span class="custom">Dolor</span>.</p>
<p>Lorem Ipsum <code>Dolor</code>.</p>

</div>
<!-- content end -->
Expand All @@ -84,14 +52,7 @@ <h1>Some Page</h1>
</div>
</div>
</main>
<footer class="bg-primary text-light">
<div class="container">

<p>Generated by <a href="https://www.phpdoc.org/">phpDocumentor</a>.</p>

</div>
</footer>


<!-- Optional JavaScript; choose one of the two! -->

<!-- Option 1: Bootstrap Bundle with Popper -->
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<!-- content start -->
<div class="section" id="page-1">
<h1>Page 1</h1>

<p>This is a Markdown document with some basic formatting.</p>

</div>
<div class="section" id="markdown-with-links">
<div class="section" id="markdown-with-links">
<h1>Markdown with links</h1>

<p>This is a Markdown document with some basic formatting.</p>
Expand Down
Loading