Hi,
I am trying to simplify a couple of things on the website that I am building.
What I want to achieve is to, use partial to grab from 1st occurrence <h2>
element with id="method"
and paste what after the first occurrence of <h2
with id=method
but not after the next one (this may be tricky)
example markdown
## Method
lorem ipsum lorem ipsum
## Comment
dolor sit amet
return only
lorem ipsum lorem ipsum
Have looked at
{{ (findRE "<h2 id=\"method\">(.|\n)*?</h2>" .Content 1) }}
but that returning, as intended and described here)
[<h2 id="method">Method</h2>]
Know this may be a bit difficult if not imposible.
Update #1
Got something like that
{{ (findRE "Method</h2>(.|\n)*?<h2 *?" .Content) }}
which gives me
[Method</h2> <p>lorem ipsum</p><p>lorem ipsum</p> <h2]
Now todo > strip array [ ]
, replace unwanted bits with empty (know how) and then make it plain (plainify?)