• Resolved bsy-web

    (@bsy-web)


    codemagic/js/beautify-html.js is putting “\n” after html tags which should not be broken up due to HTML white-space behavior.

    HTML Input:

    <p>super-<em>duper</em>-friendly<p>

    HTML Output:

    <p>
                super-
                <em>
                      duper
                </em>
                -friendly
            </p>

    Browser output:
    super- duper -friendly
    *note the spaces before and after “duper”

    This is occurring for all white-space sensitive tags such as:

    <em>
            <strong>
            <sup>
            <a>
            <p>

    —–
    I looked at the beautify.js online demo, HTML Tidy online demo, and FireBug add-on and none of those code formatting split <p> or the other tags listed above (they are all on one line).

    I submitted an issue to the GitHub maintainer for CodeMagic and he acknowledged it as a bug. Are you aware of this issue or is there a work around for it?

    I’ve searched for a long time, and no one who uses the plugin with this feature is reporting the issue. Great plug-in.

    —–
    A more involved test-case with output from the plug-in’s HTML editor (note how carriage returns will always add space when rendered by the browser):

    <p>
        A test of nested paragraph tags...
    </p>
    <p>
        This is the nested content. And nest
        <em>italics<strong>as<em>well</em>
        </strong>
        .
        </em>
    </p>
    <p>
        This is a
        <em>multi</em>
        -format test.
    </p>
    <p>
        This is
        <strong>bold</strong>
        . There should not be a space between the format and the ending punctuation.
    </p>
    <p>
        How about super
        <sup>2</sup>
        ? Were any
        <a href="https://www.google.com">extraneous</a>
        spaces added before and/or after the
        <a href="https://google.com">superscript</a>
        ? Verify that the question marks in this paragraph also have no preceeding spaces.
    </p>

Viewing 3 replies - 16 through 18 (of 18 total)
  • Plugin Author Josh

    (@josh401)

    My fault, @bsy-web. I totally missed this.

    So was the only edit to source files the change ‘true’ to ‘false’?

    Thread Starter bsy-web

    (@bsy-web)

    @josh: Yes, most recent edit to have “Wrap lines” unchecked by default was only to change:
    /codemagic/js/codemajic.js, line 6: wraptext_active: true to wraptext_active: false

    I verified on my local build on Chrome, Opera, Safari and Firefox. All started CodeMagic modal window with wrap line option unchecked, allowing for standard editing.

    If the user checks the option, same problem appears, in which case they just need to uncheck again.

    Please confirm in your local build.

    Plugin Author Josh

    (@josh401)

    Perfect, Perfect. Will make the change on my end as well.

    Yes, will definitely check and confirm.

    Thank you very, very much… my friend!!

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘HTML editor adds white-space which alters original HTML (semantically&visually)’ is closed to new replies.