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

How do block parsers work?! #404

Open
Hobart2967 opened this issue Mar 11, 2021 · 0 comments
Open

How do block parsers work?! #404

Hobart2967 opened this issue Mar 11, 2021 · 0 comments

Comments

@Hobart2967
Copy link

Hobart2967 commented Mar 11, 2021

I am getting desperate over here. Trying to write a block parser for this kind of thing:

<<<<
====Tab1 Title
My content of tab 1
====Tab2 Title
My content of tab2
====Tab3 Title
My content of tab3
====Tab4 Title
My content of tab4
>>>>

Should be converted into:

<div class="tab-control">
   <div class="tab-titles">
      <div>Tab1 Title</div>
      <div>Tab2 Title</div>
      <div>Tab3 Title</div>
      <div>Tab4 Title</div>
   </div>
   <div class="tab-content" attr-index="1">
      My content of tab 1
   </div>
   <div class="tab-content" attr-index="2">
      My content of tab 2
   </div>
   <div class="tab-content" attr-index="3">
      My content of tab 3
   </div>
   <div class="tab-content" attr-index="4">
      My content of tab 4
   </div>
</div>

Tried copying fences block parser and modify it to my needs. But I can't even find out what it does. For me it looks like

voodoo voodoo voodoo voodoo voodoo

I totally miss regex and many more... There's not even a starting tag recognizable. How does this work? Appreciate any help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant