Giter VIP home page Giter VIP logo

Comments (3)

sideshowbarker avatar sideshowbarker commented on August 26, 2024

Have you tested this and does it actually work? If so, can you please let me know exactly what config options you have set? Because even when I use "--wrap-attributes no", it still wraps all attributes. And even if I set "wrappable = no" in line 1163, it still wraps all attributes. And if I put an 'fprintf(stderr, "value: %s\n", attr->value);' at line 1128, I can see that the attribute value has already been wrapped before it was passed to the PPrintAttribute function.

Anyway, I agree that tidy should not be wrapping title attributes. But as far as I can see, making this code change is not going to have any affect. There must be something I'm missing here.

from tidy-html5.

sideshowbarker avatar sideshowbarker commented on August 26, 2024

So after walking through the code, I find ParseValue in the lexer and see that is has munge=yes but that can be overridden y TidyLiteralAttribs, which is set by the --literal-attributes config option. So I guess you must have the option set too. Because if you don't have that set, the lexer code is always going to "munge" attribute values long before the pretty-printing code is executed, regardless of whatever options you have set.

But now I find that if I do "tidy --literal-attributes yes --wrap-attributes yes", no attribute values get wrapped, ever. So it's still not clear to me what's going on here.

So It would be really helpful to know exactly which options you have set.

from tidy-html5.

sideshowbarker avatar sideshowbarker commented on August 26, 2024

OK, looking at the docs finally I understand the logic and what --wrap-attributes does. It only wraps attribute values in cases where the value makes the line length longer than the value of the "wrap" option. So anyway, I agree it should not be doing that for the value of the title attribute, so I'll go ahead and make this change.

from tidy-html5.

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.