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

Use custom namespace to flag div sections #17

Merged
merged 6 commits into from
Oct 16, 2020
Merged

Conversation

zkamvar
Copy link
Contributor

@zkamvar zkamvar commented Oct 16, 2020

This modifies the flags for native and fenced divs in their own namespace. This makes sure that we avoid modification of the document as much as possible (though we still fix native divs because sometimes valid markdown can become trapped in these blocks)

  • label_div_tags() is now split up into find_div_tags(), make_div_table(), and add_pegboard_nodes().
  • clean_fenced_divs() is now deprecated and removed from code coverage calculations because it no longer serves a purpose for our lessons (which is good because that function was >80 lines)
  • get_ns() applies the appropriate prefixes for the namespace (md for commonmark, and pb for pegboard). The output of this function is used in the xml_find_* functions.

This pr will fix #16 and address #12

This is certainly not ready or working, but I've gotten most of the way
there by adding custom nodes above and below the delimitors. The snag
I'm hitting now is what happens when we mix them.
 - label_div_tags has been split into smaller functions
 - things still don't work at the moment, but we are getting to a better
   consensus of what things should be
This is the first time the tests pass!
@zkamvar zkamvar merged commit 4529571 into main Oct 16, 2020
@zkamvar zkamvar deleted the znk-use-namespace branch October 16, 2020 22:40
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

Successfully merging this pull request may close these issues.

Use separate namespace for labelling div elements
1 participant