Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Functions | Variables
markdown_it.common.utils Namespace Reference

Functions

int|None charCodeAt (str src, int pos)
 
str|None charStrAt (str src, int pos)
 
list[_ItemTV] arrayReplaceAt (list[_ItemTV] src, int pos, list[_ItemTV] newElements)
 
bool isValidEntityCode (int c)
 
str fromCodePoint (int c)
 
str replaceEntityPattern (str match, str name)
 
str unescapeAll (str string)
 
str stripEscape (str string)
 
str escapeHtml (str raw)
 
str escapeRE (str string)
 
bool isSpace (int|None code)
 
bool isStrSpace (str|None ch)
 
bool isWhiteSpace (int code)
 
bool isPunctChar (str ch)
 

Variables

 _ItemTV = TypeVar("_ItemTV")
 
 UNESCAPE_ALL_RE
 
 DIGITAL_ENTITY_BASE10_RE = re.compile(r"#([0-9]{1,8})")
 
 DIGITAL_ENTITY_BASE16_RE = re.compile(r"#x([a-f0-9]{1,8})", re.IGNORECASE)
 
str ESCAPABLE = r"""\\!"#$%&'()*+,./:;<=>?@\[\]^`{}|_~-"""
 
 ESCAPE_CHAR = re.compile(r"\\([" + ESCAPABLE + r"])")
 
 REGEXP_ESCAPE_RE = re.compile(r"[.?*+^$[\]\\‍(){}|-]")
 
dict MD_WHITESPACE
 

Detailed Description

Utilities for parsing source text

Function Documentation

◆ arrayReplaceAt()

list[_ItemTV] markdown_it.common.utils.arrayReplaceAt ( list[_ItemTV]  src,
int  pos,
list[_ItemTV]   newElements 
)
Remove element from array and put another array at those position.
Useful for some operations with tokens

◆ charCodeAt()

int | None markdown_it.common.utils.charCodeAt ( str  src,
int  pos 
)
Returns the Unicode value of the character at the specified location.

@param - index The zero-based index of the desired character.
If there is no character at the specified index, NaN is returned.

This was added for compatibility with python

◆ charStrAt()

str | None markdown_it.common.utils.charStrAt ( str  src,
int  pos 
)
Returns the Unicode value of the character at the specified location.

@param - index The zero-based index of the desired character.
If there is no character at the specified index, NaN is returned.

This was added for compatibility with python

◆ escapeHtml()

str markdown_it.common.utils.escapeHtml ( str  raw)
Replace special characters "&", "<", ">" and '"' to HTML-safe sequences.

◆ fromCodePoint()

str markdown_it.common.utils.fromCodePoint ( int  c)
Convert ordinal to unicode.

Note, in the original Javascript two string characters were required,
for codepoints larger than `0xFFFF`.
But Python 3 can represent any unicode codepoint in one character.

◆ isPunctChar()

bool markdown_it.common.utils.isPunctChar ( str  ch)
Check if character is a punctuation character.

◆ isSpace()

bool markdown_it.common.utils.isSpace ( int | None  code)
Check if character code is a whitespace.

◆ isStrSpace()

bool markdown_it.common.utils.isStrSpace ( str | None  ch)
Check if character is a whitespace.

◆ isWhiteSpace()

bool markdown_it.common.utils.isWhiteSpace ( int  code)
Zs (unicode class) || [\t\f\v\r\n]

◆ replaceEntityPattern()

str markdown_it.common.utils.replaceEntityPattern ( str  match,
str  name 
)
Convert HTML entity patterns,
see https://spec.commonmark.org/0.30/#entity-references

◆ stripEscape()

str markdown_it.common.utils.stripEscape ( str  string)
Strip escape \\ characters

Variable Documentation

◆ MD_WHITESPACE

dict markdown_it.common.utils.MD_WHITESPACE
Initial value:
1= {
2 0x09, # \t
3 0x0A, # \n
4 0x0B, # \v
5 0x0C, # \f
6 0x0D, # \r
7 0x20, # space
8 0xA0,
9 0x1680,
10 0x202F,
11 0x205F,
12 0x3000,
13}

◆ UNESCAPE_ALL_RE

markdown_it.common.utils.UNESCAPE_ALL_RE
Initial value:
1= re.compile(
2 r'\\([!"#$%&\'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])' + "|" + r"&([a-z#][a-z0-9]{1,31});",
3 re.IGNORECASE,
4)