MCPcopy Create free account
hub / github.com/codemix/htmling / peg$c54

Function peg$c54

lib/parser.js:190–225  ·  view source on GitHub ↗
(attrs, content)

Source from the content-addressed store, hash-verified

188 peg$c52 = "<script",
189 peg$c53 = { type: "literal", value: "<script", description: "\"<script\"" },
190 peg$c54 = function(attrs, content) {
191 var statement = {
192 type: 'OutputStatement',
193 raw: true,
194 expression: {}
195 };
196
197 if (attrs) {
198 var parsed = parse(attrs);
199 if (parsed.body.length > 1) {
200 parsed.type = 'BlockStatement';
201 parsed.body.unshift({
202 type: 'OutputStatement',
203 raw: true,
204 expression: {
205 type: 'Literal',
206 value: '<script',
207 raw: '"<script"'
208 }
209 });
210 statement.expression = {
211 type: 'Literal',
212 value: content,
213 raw: JSON.stringify(content)
214 };
215 parsed.body.push(statement);
216 return parsed;
217 }
218 }
219 statement.expression = {
220 type: 'Literal',
221 value: '<script' + (attrs || '' ) + content,
222 raw: JSON.stringify('<script' + (attrs || '' ) + content)
223 };
224 return statement;
225 },
226 peg$c55 = { type: "other", description: "Script Content" },
227 peg$c56 = /^["'`=<>]/,
228 peg$c57 = { type: "class", value: "[\"'`=<>]", description: "[\"'`=<>]" },

Callers 1

peg$parseSCRIPT_ELEMENTFunction · 0.85

Calls 1

parseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…