Skip to main content

data_attribute

Function data_attribute 

Source
pub fn data_attribute(field: &str) -> String
Expand description

Returns the attribute name a payload field is written under: DATA_PREFIX followed by field with every _ and . turned into -.

§Examples

use flm_core::stdlib::backends::html::names::data_attribute;

assert_eq!(data_attribute("level"), "data-flm-level");
assert_eq!(data_attribute("source_span"), "data-flm-source-span");