GithubHelp home page GithubHelp logo

Comments (6)

 avatar commented on June 5, 2024 1

oh placeholder is the only that works. the docs are correct nvm.

from rehype-sanitize.

leafac avatar leafac commented on June 5, 2024 1

@wooorm: First, thanks for all your work on unified and related projects. It’s a joy to work with πŸ˜€

Second, I just got bitten by this 🀷

Since two years ago, when you marked this as wontfix, could you perhaps have reconsidered the situation? Perhaps make attribute case-insensitive (I believe that HTML attributes are case-insensitive, right?)?

Otherwise, would you accept a pull request noting that β€œplaysInline, for example, should be playsInline” more prominently in the documentation? Perhaps both here and in https://github.com/syntax-tree/hast-util-sanitize#schema?

Thanks in advance.

from rehype-sanitize.

wooorm avatar wooorm commented on June 5, 2024

Hi @personaaleatoria, welcome! This behavior is expected: we support hast property names (autoFocus, srcSet, inputMode, spellCheck)

from rehype-sanitize.

 avatar commented on June 5, 2024

Thanks it worked. One note: I've tried placeHolder and it worked but in the documentation it says that it stays the same: https://github.com/syntax-tree/hast#propertyname.

when it says, "previous rules apply" does it mean that both placeholder and placeHolder are expected to work?

from rehype-sanitize.

wooorm avatar wooorm commented on June 5, 2024

Can you open a new issue, to improve the docs? (Or maybe even a PR!)

from rehype-sanitize.

robertu7 avatar robertu7 commented on June 5, 2024

Thanks, it works!

import rehypeSanitize, { defaultSchema } from 'rehype-sanitize'


...
  .use(rehypeSanitize, {
    tagNames: [
      ...defaultSchema.tagNames!,
      'iframe',
      'footer',
      'header',
      'audio',
      'source',
    ],
    attributes: {
      ...defaultSchema.attributes,
      a: ['href', 'ref', 'target'],
      img: ['src', 'srcSet', 'data*'],
 ...

from rehype-sanitize.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.