Skip to content

Feature request: Add option to keep element on same line if inside line width with splitMultiAttrs activated #14

Description

@jansohn

We want to switch to enabling splitMultiAttrs in our projects when formatting our (X)HTML files for better readability. This is great for elements with a lot of attributes but not so great for 2-3 attributes which would easily still fit inside the same line width.

Example:

<h:outputStylesheet library="webjars" name="font-awesome/4.7.0/css/font-awesome.min-jsf.css" />

gets formatted to the following no matter the line width:

<h:outputStylesheet
  library="webjars"
  name="font-awesome/4.7.0/css/font-awesome.min-jsf.css" />

I would like to see an additional option to not split the attributes if they fit on the same line.

Change would probably need to be done somewhere here: https://github.com/eclipse-sourceediting/sourceediting/tree/master/web/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/format

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions