mbylstra / html-to-elm

An online tool for converting HTML to elm-html. Go to
http://mbylstra.github.io/html-to-elm/
395 stars 23 forks source link

Issue with single-quote in attribute #22

Closed kamn closed 7 years ago

kamn commented 7 years ago

Trying to convert the following template (from RealWorld project) fails part way because of a single quote in the plaecholder attribute

<form>
  <fieldset>
    <fieldset class="form-group">
      <input type="text" class="form-control" placeholder="What's this article about?">
    </fieldset>
    <button class="btn btn-lg pull-xs-right btn-primary" type="button">
      Publish Article
    </button>
  </fieldset>
</form>

and returns

form []
    [ fieldset []
        [ fieldset [ class "form-group" ]
            []
        ]
    ]

Compared to...

<form>
  <fieldset>
    <fieldset class="form-group">
      <input type="text" class="form-control" placeholder="Whats this article about?">
    </fieldset>
    <button class="btn btn-lg pull-xs-right btn-primary" type="button">
      Publish Article
    </button>
  </fieldset>
</form>

and...

form []
    [ fieldset []
        [ fieldset [ class "form-group" ]
            [ input [ class "form-control", placeholder "Whats this article about?", type_ "text" ]
                []
            ]
        , button [ class "btn btn-lg pull-xs-right btn-primary", type_ "button" ]
            [ text "Publish Article    " ]
        ]
    ]
mbylstra commented 7 years ago

Hi. Thanks for the issue. This has been fixed in https://github.com/mbylstra/html-to-elm/commit/825da58c4772d702dbe7354deac6468db51dfb76 and published to the website.