====== Containers ======
Containers is a way to limit area of usage of some style/scope/label by specific parent (surrounding) style.
The logic is following:
- You have styles. [[syntax:styles|Styles]] are described by //Blocks//, //Keywords//, and //Words// conditions and applied to some interval of the text (text block).
- [[syntax:styles|Styles]] can be referred by style //id//. If //id// attribute is not defined HippoEDIT will use value of //name// attribute as id.
- When you define container (or containers) for [[syntax:scopes|Scope]] or another schema object, you allow this [[syntax:scopes|Scope]], [[syntax:styles|Style]] or [[syntax:labels|Label]] etc to be recognized only in the style specified by container //id//.
For example this mean:
//Scope// with open tag "{" allowed only in the //style// "test_container_name". If it would be found in some other style, it would be skipped. If you do not specify containers, HippoEDIT assumes that this object ([[syntax:scopes|scope]], [[syntax:styles|style]] or [[syntax:labels|label]]) allowed only in normal style (style with //id// = normal, defined in def_spec.xml).
For objects as [[syntax:scopes|Scope]] and [[syntax:styles|Style]] you can define containers for open part and for close part (for scopes also for middle part). For example CSS block in HTML can be started in normal style of HTML code and can be closed inside CSS normal or comment style.
If you do not define an open container, it would be //normal// style of current language.
By default, all styles without //Container// node (//Open// or //Close//) implicitly allowed to be located inside a //normal// style. If you define a //Container// node, you implicitly overwrite such assignment and allow usage of the style only inside of container explicitly specified. If you want the style to still be allowed inside of //normal// style, you need to add //normal// to list of allowed containers.
If you want to refer to a style from another [[terms:syntax-schema|syntax schema]], you can do this as well, by giving syntax id before style id separated with ":" :