Pardon our dust! Docs for Yarn Spinner for Unity 3.2 and Yarn Spinner for Godot C# are on docs.yarnspinner.dev (the old docs site). Docs for Yarn Spinner for Unity 3.3 (pre-release, out ASAP), Yarn Spinner for Godot GDScript and Yarn Spinner for Unreal Engine (work in progress) are on /docs/ (the new docs site).

YarnMarkupParser

parses yarn spinner markup and transforms it using registered processors. uses YarnLineParser internally with a backwards-compatible API.
class_name YarnMarkupParser
extends RefCounted

Inherits from RefCounted

#Constants

#BBCODE_TAG_END

const BBCODE_TAG_END = ""

#BBCODE_TAG_START

const BBCODE_TAG_START = ""

#Properties

#locale_code

var locale_code: String = "en"

Type String

#Methods

#bbcode_tag(String)

static func bbcode_tag(tag: String) -> String

Parameters

  • tagString

Returns String

#brackets_to_tags(String)

static func brackets_to_tags(bbcode: String) -> String

Parameters

  • bbcodeString

Returns String

#convert_to_bbcode(YarnMarkupParseResult)

func convert_to_bbcode(parse_result: YarnMarkupParseResult) -> String

Parameters

Returns String

#deregister_marker_processor(String)

func deregister_marker_processor(attribute_name: String) -> void

Parameters

  • attribute_nameString

#escape_text(String)

static func escape_text(text: String) -> String

Parameters

  • textString

Returns String

#get_palette_processor()

func get_palette_processor() -> YarnPaletteMarkupProcessor

Returns YarnPaletteMarkupProcessor

#get_style_processor()

func get_style_processor() -> YarnStyleMarkupProcessor

Returns YarnStyleMarkupProcessor

#parse_to_result(String, bool)

parse markup and return a YarnMarkupParseResult.
func parse_to_result(text: String, add_implicit_character: bool = true) -> YarnMarkupParseResult

Parameters

  • textString
  • add_implicit_characterbool

Returns YarnMarkupParseResult

#parse(String)

parse markup in text and return processed result (backwards-compatible API) returns a dictionary with: - text: the processed text with BBCode - character_name: extracted character name (empty if none) - attributes: array of parsed attribute info supports escaping: \[ and \] for literal brackets
func parse(text: String) -> Dictionary

Parameters

  • textString

Returns Dictionary

#register_marker_processor(String, YarnAttributeMarkerProcessor)

func register_marker_processor(attribute_name: String, processor: YarnAttributeMarkerProcessor) -> void

Parameters

#register_processor(YarnMarkupAttributeProcessor)

func register_processor(processor: YarnMarkupAttributeProcessor) -> void

Parameters

#strip_bbcode_tags(String)

static func strip_bbcode_tags(text: String) -> String

Parameters

  • textString

Returns String

#unregister_processor(YarnMarkupAttributeProcessor)

func unregister_processor(processor: YarnMarkupAttributeProcessor) -> void

Parameters

Generated from Yarn Spinner for Godot GDScript 3.3.