Created by: Starsam80
First commit removes a lot of duplication by using loops. In fact, I can reduce the duplication even more by using {% cycle %}
but then it starts looking like code-golf, so I'm not going to do that.
The second commit just puts the bd-highlight
class in front of the p-2
class, so when it parses, it will hide the p-2
class. A lot of this is pointless because it'll get replaced with ...
later.
The third commit merges the 2 functions we had before (remove_holderjs
and remove_example_classes
) and puts it into a new function called cleanup_highlighted_code
. The TODO comment was when I realized that regex does not parse HTML and should be replaced by something better.
The 2 new features that I've also added in this commit are:
- The
data-bd-hide
attribute, which hides the attributes that follow it.-
<div class="d-flex" data-bd-hide style="height: 100px;">
=><div class="d-flex">
-
- The
data-bd-remove
attribute, which replaces the entire element with...
-
<div data-bd-remove class="d-flex">
=>...
-
Please note that these are not going to work 100% of the time, because of the way HTML and regex work.
The fourth commit uses the stuff that I added in the previous commit. I plan to do this to every single file, but I first need to fix the TODO.
For people that want to see what this changes, I've made a build of the docs here: https://bootstrap-tests.starsam80.net/more-bd/utilities/flexbox/