feat: tumblr grammar with highlights, injections, and tests

This commit is contained in:
2026-05-17 05:50:17 +02:00
parent 1596154284
commit c61fa5c53b
11 changed files with 1950 additions and 55 deletions
+139
View File
@@ -0,0 +1,139 @@
==================
Simple block
==================
{block:Posts}{/block:Posts}
---
(template
(content)
(block_open
(block_name))
(block_close
(block_name))
(content))
==================
Block with content
==================
{block:Posts}<article>{Body}</article>{/block:Posts}
---
(template
(content)
(block_open
(block_name))
(content)
(variable
(variable_name))
(content)
(block_close
(block_name))
(content))
==================
Nested blocks
==================
{block:Posts}{block:Text}{Body}{/block:Text}{/block:Posts}
---
(template
(content)
(block_open
(block_name))
(block_open
(block_name))
(variable
(variable_name))
(block_close
(block_name))
(block_close
(block_name))
(content))
==================
Block with one attribute
==================
{block:Photoset rows="3"}{Photoset}{/block:Photoset}
---
(template
(content)
(block_open
(block_name)
(attributes
(attribute
(attribute_name)
(attribute_value))))
(variable
(variable_name))
(block_close
(block_name))
(content))
==================
Block with multiple attributes
==================
{block:Photoset rows="3" gutter="10px"}{/block:Photoset}
---
(template
(content)
(block_open
(block_name)
(attributes
(attribute
(attribute_name)
(attribute_value))
(attribute
(attribute_name)
(attribute_value))))
(block_close
(block_name))
(content))
==================
Case insensitive block keyword
==================
{Block:Photo}{/Block:Photo}
---
(template
(content)
(block_open
(block_name))
(block_close
(block_name))
(content))
==================
Conditional block
==================
{block:IfShowSidebar}{block:IfNotHidden}content{/block:IfNotHidden}{/block:IfShowSidebar}
---
(template
(content)
(block_open
(block_name))
(block_open
(block_name))
(content)
(block_close
(block_name))
(block_close
(block_name))
(content))