How to tell if a given tag name is a block tag?
See original GitHub issueGiven a tag name, how can I pro-grammatically tell if the tag is a block tag?
“Blocks” are tags that contain a block of template code which is delimited by a {% end<TAGNAME> %} tag.
In Ruby Liquid, I can do it with the following code:
Liquid::Template.tags[tag_name].ancestors.include?(Liquid::Block)
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Block-level elements - HTML: HyperText Markup Language
In this article, we'll examine HTML block-level elements and how they differ from inline-level elements.
Read more >How to detect if an in memory DOM element is a block element?
The only way I see to do what you're describing is to hardcode the list of phrasing-only element types and check the tag...
Read more >HTML Block and Inline Elements - W3Schools
A block-level element always starts on a new line, and the browsers automatically add some space (a margin) before and after the element....
Read more >Block and Inline Elements
You can now wrap links around block level elements. An example makes this clear. It's common to mark up the name of the...
Read more >Getting block tag names - Autodesk Community - AutoCAD
It verifies that selected entity IS a block and HAS some attributes. ... (with drop-down list) to select one from these found tag...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m considering introduce a
BlockTag
type, for which liquid automatically parse until the corresponding end tag. Then you can test the type either byinstanceof
or.type
property.Since there’s no plan to support this, closing.