|
|
|
@ -3,8 +3,11 @@ import mustache from './mustache';
|
|
|
|
import tag from './tag';
|
|
|
|
import tag from './tag';
|
|
|
|
import text from './text';
|
|
|
|
import text from './text';
|
|
|
|
|
|
|
|
|
|
|
|
export default (parser: Parser) =>
|
|
|
|
export default function fragment(parser: Parser) {
|
|
|
|
[
|
|
|
|
return (
|
|
|
|
{ match: '<', fragment: tag },
|
|
|
|
[
|
|
|
|
{ match: '{', fragment: mustache }
|
|
|
|
{ match: '<', fragment: tag },
|
|
|
|
].find(({ match }) => parser.match(match))?.fragment ?? text;
|
|
|
|
{ match: '{', fragment: mustache }
|
|
|
|
|
|
|
|
].find(({ match }) => parser.match(match))?.fragment ?? text
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|