Skip to content

Commit

Permalink
added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tovedetered committed Apr 5, 2024
1 parent 65c9f65 commit f475b41
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/xmleam/xml_builder.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ pub fn tag(document: XmlBuilder, label: String, contents: String) -> XmlBuilder
}
}

/// this is a basic tag that automatically adds the CDATA tag to the XML
/// NOTE: This same effect can be created with any other tag by adding
/// <![CDATA[ ... ]]> to the content blocks, this is just for convienence
pub fn cdata_tag(document: XmlBuilder, label: String, contents: String) {
let label_empty = string.is_empty(label)
use <- bool.guard(when: label_empty, return: Error(LabelEmpty))
Expand Down

0 comments on commit f475b41

Please sign in to comment.