Coder Social home page Coder Social logo

closing <script> tag generates invalid HTML about shakespeare HOT 9 CLOSED

yesodweb avatar yesodweb commented on July 22, 2024
closing

Comments (9)

gregwebs avatar gregwebs commented on July 22, 2024

is Hamlet actually supposed to allow closing tags?

from shakespeare.

akonsu avatar akonsu commented on July 22, 2024

yes, according to the book (http://www.yesodweb.com/book/templates). Please see "Syntax/Hamlet Syntax/Tags" section.

from shakespeare.

gregwebs avatar gregwebs commented on July 22, 2024

I think that only "inner" closing tags are allowed. Or do you see this
working with other tags besides script?

I will leave this ticket open as a reminder for Michael to make the
documentation a little more clear on this point.

On Fri, Sep 30, 2011 at 7:43 AM, akonsu <
[email protected]>wrote:

yes, according to the book (http://www.yesodweb.com/book/templates).
Please see "Syntax/Hamlet Syntax/Tags" section.

Reply to this email directly or view it on GitHub:
https://github.com/yesodweb/hamlet/issues/21#issuecomment-2250227

from shakespeare.

akonsu avatar akonsu commented on July 22, 2024

I think I saw this working with other tags as well. Thanks for looking at
it.

2011/9/30 Greg Weber <
[email protected]>

I think that only "inner" closing tags are allowed. Or do you see this
working with other tags besides script?

I will leave this ticket open as a reminder for Michael to make the
documentation a little more clear on this point.

On Fri, Sep 30, 2011 at 7:43 AM, akonsu <
[email protected]>wrote:

yes, according to the book (http://www.yesodweb.com/book/templates).
Please see "Syntax/Hamlet Syntax/Tags" section.

Reply to this email directly or view it on GitHub:
https://github.com/yesodweb/hamlet/issues/21#issuecomment-2250227

Reply to this email directly or view it on GitHub:
https://github.com/yesodweb/hamlet/issues/21#issuecomment-2250495

from shakespeare.

snoyberg avatar snoyberg commented on July 22, 2024

@akonsu: Can you point out which sentence implied that closing tags would work? I'm actually not opposed to having Hamlet ignore closing tags when given on their own line, it might make things a little easier to work with. Any objections?

from shakespeare.

akonsu avatar akonsu commented on July 22, 2024

here is a quote:

<p>Paragraph <i>italic</i> end.

Notice that the first tag will be automatically closed by Hamlet, while the inner "i" tag will not. You are free to use whichever approach you want, there is no penalty for either choice.

from shakespeare.

gregwebs avatar gregwebs commented on July 22, 2024

I am not against allowing closing tags. But it seems that the point is it to allow copy-and-paste html. And I am wondering if we are better off offering a transformer that turns normal html into Hamlet. You would need at least the pretty-printing and white-space changes from the transformer anyways even if it didn't remove closing tags.

Partly i am scared by this example which isn't a good use case (and should be using the real javascript api also).

from shakespeare.

snoyberg avatar snoyberg commented on July 22, 2024

Good points. We already have html2hamlet, which should address that need. I think it makes sense to leave things as-is for now.

from shakespeare.

gregwebs avatar gregwebs commented on July 22, 2024

I added a relevant comment in the book

from shakespeare.

Related Issues (20)

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.