neutralts::utils

Function get_code_position

Source
pub fn get_code_position(src: &str) -> Option<usize>
Expand description

Finds the position of the first occurrence of BIF_CODE_B in the source string, but only when it is not inside any nested brackets.

                  .------------------------------> params
                  |       .----------------------> this
                  |       |
                  |       |                 .----> code
                  |       |                 |
                  v       v                 v
             ------------ -- ------------------------------
 {:!snippet; snippet_name >> <div>... {:* ... *:} ...</div> :}