Пример #1
0
 /// <summary>
 /// Create a JsonLd Script-TagBase
 /// </summary>
 /// <param name="content">the contents in the tag</param>
 public ScriptJsonLd(string content)
 {
     Type("application/ld+json");
     // https://w3c.github.io/json-ld-syntax/#restrictions-for-contents-of-json-ld-script-elements
     // Authors should avoid using character sequences in scripts embedded in HTML which may be confused
     // with a comment-open, script-open, comment-close, or script-close.
     TagContents = XssPrevention.JsonLdScriptEncoding(content);
 }
Пример #2
0
 public void JsonLdScriptEncoding(string content, string expected) => Assert.AreEqual(expected, XssPrevention.JsonLdScriptEncoding(content));