Code Monkey home page Code Monkey logo

elm-html-string's People

Contributors

ravendream avatar zwilias avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

elm-html-string's Issues

Elm 0.19 migration

Hi,

We are using since a year your library, and it works well. (Thank you)

Since Elm 0.19 is out, we waited all our dependencies to be up to date for migration. I checked again today for all our dependencies, and it seems elm-html-string is the only left to be migrated.

I've already forked your project and make migration, you can see it here :

https://github.com/azuken/elm-html-string

My problem is with Event attribute type, which use onWithOptions, removed in Elm 0.19. You must use Html.Events.custom now.

This method accept two parameters (event name, and decoder with message and options), instead of three (name, options, and msg decoder). I tried to figured out the error, but I'm stuck with map functions (mapAttributes & mapChildren). Can you please check it, and if you are able to, tell me how to fit it ?

I am creating a pull request for easier readability.

Thank you in advance !

Azuken

Cooperation with elm-css

Hello,

I have an established Elm project that uses RtFeldman's elm-css to add type safety in my CSS. Now I want to export this Html as pdf.

For this I want to use elm-html-string. I can convert my current structure in elm-css' Html to elm-core's Html. However, by that point I can't get it to work with this library anymore, as there is no fromHtml (probably with good reason).

Is there any way for me to keep the CSS-type safety that elm-css gives me and also render the Html as a regular Html string?

Thanks in advance.

Void tags like img are rendered with invalid closing tag

img is a void tag and is invalid and not supported in some contexts if it is rendered with a closing tag.

https://html.spec.whatwg.org/multipage/syntax.html#void-elements

This StackOverflow answer describes it a little bit more.

This W3C HTML validator, for example, gives an error with the following input:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>
<body>
<img src="http://example.com/asdf.jpg" alt="foo"></img>
</body>
</html>

Error: Stray end tag img.

If you remove the closing </img> (and optionally do a self-closing img tag), the error goes away.

I've been using this library for testing some output in my elm-markdown end-to-end tests and realized that a few test cases are failing because it isn't recognizing the HTML output as equal because of these void elements rendering with closing tags.

Expose Html type variants

It would be nice to be able to inspect the contents of Html. My use case for this is to be able to recursively check for base64 images in some html and convert them into attachments when sending html in an email. Right now this isn't possible since the Html type is opaque.

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.