Giter Site home page Giter Site logo

angular-html5's People

Contributors

janeisklar avatar pgilad avatar troywarr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

angular-html5's Issues

Conversion to HTML5 self-closing tags breaks browser SVG parsing

I'm using gulp-angular-htmlify in my build process, and just found it to be at the root an issue with broken SVG rendering. The symptom is that any SVG elements in my HTML document that contain more than one child element (e.g., multiple <path>s) are only rendering the first child element. When I view the generated source, I notice that the browser has interpreted them as nested elements:

<svg>
  <path>
    <path>
      <path>
</svg>

It appears that the gulp-angular-htmlify output tries to convert any XHTML-style self-closing tags (e.g., <path/>) to their HTML5 equivalent (e.g., <path>). However, in the case of SVG or MathML elements included in HTML documents, this is against the spec:

http://www.w3.org/TR/html-markup/syntax.html#svg-mathml

Those elements must preserve the self-closing slash to be parsed correctly by browsers (at least the latest Chrome/Mac, where I've seen this issue). Removing the gulp-angular-htmlify step from my Gulpfile fixed the problem immediately.

I've only had a brief chance to look at the source code - could this have something to do with parsing via cheerio?

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.