How to use the lwc.sanitizeAttribute function in lwc

To help you get started, we’ve selected a few lwc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github salesforce / lwc / packages / @lwc / template-compiler / src / __tests__ / fixtures / attributes / mixed-props-attrs / expected.js View on Github external
"svg",
      {
        classMap: {
          cubano: true
        },
        attrs: {
          focusable: "true"
        },
        key: 4
      },
      [
        api_element(
          "use",
          {
            attrs: {
              "xlink:href": sanitizeAttribute(
                "use",
                "http://www.w3.org/2000/svg",
                "xlink:href",
                "xx"
              )
            },
            key: 3
          },
          []
        )
      ]
    ),
    api_element(
      "table",
      {
        attrs: {
github salesforce / lwc / packages / @lwc / template-compiler / src / __tests__ / fixtures / svg / scoped-id-static / expected.js View on Github external
href: sanitizeAttribute(
                "use",
                "http://www.w3.org/2000/svg",
                "href",
                api_scoped_frag_id("#black")
              )
            },
            key: 3
          },
          []
        ),
        api_element(
          "use",
          {
            attrs: {
              "xlink:href": sanitizeAttribute(
                "use",
                "http://www.w3.org/2000/svg",
                "xlink:href",
                api_scoped_frag_id("#red")
              )
            },
            key: 4
          },
          []
        )
      ]
    )
  ];
}
github salesforce / lwc / packages / @lwc / template-compiler / src / __tests__ / fixtures / base / svg / expected.js View on Github external
{
        classMap: {
          "slds-button__icon": true
        },
        attrs: {
          viewBox: "0 0 5 5",
          "aria-hidden": "true"
        },
        key: 1
      },
      [
        api_element(
          "use",
          {
            attrs: {
              "xlink:href": sanitizeAttribute(
                "use",
                "http://www.w3.org/2000/svg",
                "xlink:href",
                "/x"
              )
            },
            key: 0
          },
          []
        )
      ]
    )
  ];
}
github salesforce / lwc / packages / @lwc / template-compiler / src / __tests__ / fixtures / svg / xlink-with-literal-value / expected.js View on Github external
{
        classMap: {
          "slds-icon": true
        },
        attrs: {
          "aria-hidden": "true",
          title: "when needed"
        },
        key: 1
      },
      [
        api_element(
          "use",
          {
            attrs: {
              "xlink:href": sanitizeAttribute(
                "use",
                "http://www.w3.org/2000/svg",
                "xlink:href",
                "/assets/icons/standard-sprite/svg/symbols.svg#case"
              )
            },
            key: 0
          },
          []
        )
      ]
    )
  ];
}
github salesforce / lwc / packages / @lwc / template-compiler / src / __tests__ / fixtures / svg / scoped-id-static / expected.js View on Github external
r: "10",
                  cx: "14",
                  cy: "14",
                  fill: "red"
                },
                key: 1
              },
              []
            )
          ]
        ),
        api_element(
          "use",
          {
            attrs: {
              href: sanitizeAttribute(
                "use",
                "http://www.w3.org/2000/svg",
                "href",
                api_scoped_frag_id("#black")
              )
            },
            key: 3
          },
          []
        ),
        api_element(
          "use",
          {
            attrs: {
              "xlink:href": sanitizeAttribute(
                "use",
github salesforce / lwc / packages / @lwc / template-compiler / src / __tests__ / fixtures / svg / xlink-with-expression-value / expected.js View on Github external
{
        classMap: {
          "slds-icon": true
        },
        attrs: {
          "aria-hidden": "true",
          title: "when needed"
        },
        key: 1
      },
      [
        api_element(
          "use",
          {
            attrs: {
              "xlink:href": sanitizeAttribute(
                "use",
                "http://www.w3.org/2000/svg",
                "xlink:href",
                api_scoped_frag_id($cmp.getXLink)
              )
            },
            key: 0
          },
          []
        )
      ]
    )
  ];
}
github salesforce / lwc / packages / @lwc / template-compiler / src / __tests__ / fixtures / svg / scoped-id-dynamic / expected.js View on Github external
r: "10",
                  cx: "14",
                  cy: "14",
                  fill: "red"
                },
                key: 1
              },
              []
            )
          ]
        ),
        api_element(
          "use",
          {
            attrs: {
              href: sanitizeAttribute(
                "use",
                "http://www.w3.org/2000/svg",
                "href",
                api_scoped_frag_id($cmp.blackUrl)
              )
            },
            key: 3
          },
          []
        ),
        api_element(
          "use",
          {
            attrs: {
              "xlink:href": sanitizeAttribute(
                "use",
github salesforce / lwc / packages / @lwc / template-compiler / src / __tests__ / fixtures / svg / scoped-id-dynamic / expected.js View on Github external
href: sanitizeAttribute(
                "use",
                "http://www.w3.org/2000/svg",
                "href",
                api_scoped_frag_id($cmp.blackUrl)
              )
            },
            key: 3
          },
          []
        ),
        api_element(
          "use",
          {
            attrs: {
              "xlink:href": sanitizeAttribute(
                "use",
                "http://www.w3.org/2000/svg",
                "xlink:href",
                api_scoped_frag_id($cmp.redUrl)
              )
            },
            key: 4
          },
          []
        )
      ]
    )
  ];
}