MCPcopy Index your code
hub / github.com/witheve/Eve / parseInline

Function parseInline

src/commonmark.js:1888–1937  ·  view source on GitHub ↗
(block)

Source from the content-addressed store, hash-verified

1886// On success, add the result to block's children and return true.
1887// On failure, return false.
1888var parseInline = function(block) {
1889 var res = false;
1890 var c = this.peek();
1891 if (c === -1) {
1892 return false;
1893 }
1894 switch(c) {
1895 case C_NEWLINE:
1896 res = this.parseNewline(block);
1897 break;
1898 case C_BACKSLASH:
1899 res = this.parseBackslash(block);
1900 break;
1901 case C_BACKTICK:
1902 res = this.parseBackticks(block);
1903 break;
1904 case C_ASTERISK:
1905 case C_UNDERSCORE:
1906 res = this.handleDelim(c, block);
1907 break;
1908 case C_SINGLEQUOTE:
1909 case C_DOUBLEQUOTE:
1910 res = this.options.smart && this.handleDelim(c, block);
1911 break;
1912 case C_OPEN_BRACKET:
1913 res = this.parseOpenBracket(block);
1914 break;
1915 case C_BANG:
1916 res = this.parseBang(block);
1917 break;
1918 case C_CLOSE_BRACKET:
1919 res = this.parseCloseBracket(block);
1920 break;
1921 case C_LESSTHAN:
1922 res = this.parseAutolink(block) || this.parseHtmlTag(block);
1923 break;
1924 case C_AMPERSAND:
1925 res = this.parseEntity(block);
1926 break;
1927 default:
1928 res = this.parseString(block);
1929 break;
1930 }
1931 if (!res) {
1932 this.pos += 1;
1933 block.appendChild(text(fromCodePoint(c)));
1934 }
1935
1936 return true;
1937};
1938
1939// Parse string content in block into inline children,
1940// using refmap to resolve references.

Callers

nothing calls this directly

Calls 3

textFunction · 0.85
fromCodePointFunction · 0.85
peekMethod · 0.80

Tested by

no test coverage detected