rubymaniac / vscode-html-to-elm

Convert HTML to Elm code for Visual Studio Code
MIT License
18 stars 6 forks source link

Invalid elm code produced from source HTML #4

Open jpierson opened 7 years ago

jpierson commented 7 years ago

While playing around with converting the HTML from this medium article I ran across the case where some HTML is not being converted to Elm properly. I haven't been able to experiment yet with whether this is related to the seemingly non-standard t tag, comments, or the self closing <br/> tag or something else but it looks like the br is missing a the following comma.

Test case

<p><t>Bachelor of Awesomeness</t><br/>
    University of Maryland
    <!--<br/><i>Extra info here</i>-->
</p>

Expected:

p []
    [ t []
        [ text "Bachelor of Awesomeness" ]
    , br [] [] 
        , text "University of Maryland" 
    ]

Actual:

p []
    [ t []
        [ text "Bachelor of Awesomeness" ]
    , br []
        [] text "University of Maryland" 
    ]

Version

Extension version: 0.0.2

VSCode Version 1.12.2 Commit 19222cdc84ce72202478ba1cec5cb557b71163de Date 2017-05-10T13:20:36.315Z Shell 1.6.6 Renderer 56.0.2924.87 Node 7.4.0

miniBill commented 4 years ago

From my experiments the problem is the self-closing <br/> tag