SlugBuilder

Default implementation for the logic that transforms section titles, document names and user-provided ids to a slug that is compatible with HTML/XML ids, URLs and file names.

class Object
trait Matchable
class Any

Value members

Concrete methods

def default(text: String): String

Default slug builder that turns the specified string into a slug suitable as HTML or XML id, as a path segment in a URL and as a file name.

Default slug builder that turns the specified string into a slug suitable as HTML or XML id, as a path segment in a URL and as a file name.

Iterates over the input text one Unicode code point at a time. All code points that are letters or numbers or underscore are considered valid characters. They are mapped to lower case, and included in the output. All other code points are considered invalid characters, and any sequence of such code points will be replaced by a single dash character (-), unless the sequence starts or ends the string in which case it is simply dropped.