Menu

#157 line-wrap in source HTML creasts unwanted spaces

open
9
2011-07-15
2007-11-14
Zhang Weiwu
No

I truly consider this is a very high priority bug. It made Kompozer completely not usable for asian website creation.

It's actually very small bug, Kompozer should never, never add linebreak between ideographs. Kompozer add linebreak between ideographs when the line is too long in source. The result is in browsers the two ideograph looks having a space between them.

In Asian typography it's strictly clear no white space is allowed between ideographs unless in very special cases (e.g. printing the name of the God in Bible).

This happen because Kompozer tries to line-wrap source code, when it cannot (e.g. because there are 80 ideographs with no space in between), it force a linebreak at some 70 position.

In fact, in Chinese it is possible a whole book do not use a single space between any of two ideographs. Actually most books do.

The best thing is Kompozer insert linebreak for line wrapping in source code only after Chinese punctuations. If this is not possible, Kompozer should know to never to force a linebreak if there is no space in source code.

If you need I can give you a list of Chinese punctuations after which a linebreak can be added for line wrapping.

Discussion

1 2 > >> (Page 1 of 2)
  • Anonymous

    Anonymous - 2010-02-25

    This forced line wrapping also makes a mess of Japanese, adding spaces to the middle of words where they absolutely do not belong. It's a truly serious problem for people who want to use Kompozer for making/editing Japanese-language pages.

    For me, the best solution would be to have an option in Kompozer to NOT wrap long lines, period.

     
  • Zhang Weiwu

    Zhang Weiwu - 2010-02-26

    It would be highly appreciated if someone can offer a patch too.

     
  • Fabien Cazenave (kaze)

    • priority: 5 --> 9
     
  • Fabien Cazenave (kaze)

    Confirmed. Working on it.

    As we're in "string freeze" mode, the best we can do before the official 0.8 release is to add a hidden pref that will prevent the line wrap. This hidded pref would be activated in Chinese, Japanese and Korean builds.

    -- kazé, kompozer lead

     
  • Zhang Weiwu

    Zhang Weiwu - 2010-02-27

    Thank you very much for quick response. When you say hidden <pre>, do you mean something like this?

    <p>这里有一段连<pre
    ></pre>续的中文</p>

    Thanks.

     
  • Fabien Cazenave (kaze)

    No: <pre> tags don't use any line wrapping at all, they transform line feeds into <br> nodes, but that's another subject — and it doesn't affect Asian languages.

    I mentioned using a hidden *pref* (= preference) to turn off the line wrapping, i.e. a preference that is only visible with about:config.

    After the string freeze (= 0.8.1 for example) I'll probably redesign the whole "Preferences" / "Options" dialog and add a few preferences to have a better control on the HTML output: line wrapping, indentation, markup cleaner, etc. But at the moment (= 0.8beta), a hidden preference is the best I can do.

    Again, I’ll add this hidden preference to the Chinese and Japanese builds as well as in the corresponding langpacks.

    -- kazé, kompozer lead

     
  • Fabien Cazenave (kaze)

    Hum, looks like there's already a hidden preference we can use for Asian languages.

    Please install about:config for KompoZer: http://addons.kompozer.net/xpi/AboutConfig-20091204.xpi
    then look for the preference named "editor.htmlWrapColumn", set it to zero and tell me if it solves your bug.
    If this doesn't solve your bug, please attach an HTML file so I could test further.

    -- kazé

     
  • Anonymous

    Anonymous - 2010-02-28

    Hi Kaze, I had already tried setting the "editor.htmlWrapColumn" pref to zero and to other values (such as 999), but it had no effect at all.

    However, I just found a blog post which says that to make this pref work, you first need to modify editor.js as follows:

    // chrome/comm.jar/content/editor/editor.js:2473
    function UpdateWindowTitle()
    {
    try {
    var editor = GetCurrentEditor();
    if (editor) {
    editor.wrapWidth = gPrefs.getIntPref('editor.htmlWrapColumn');
    }

    var windowTitle = GetDocumentTitle();
    if (!windowTitle)

    (The original blog post, in Japanese, is at http://d.hatena.ne.jp/anon_193/20100105/1262703051 .)

    I tried tinkering with editor.js but only succeeded in making kompozer not start up anymore. :-) But maybe the above info it will be useful to you.

    I don't see a way to upload a file to this bug. Should I just post the raw code here? Or email it to you?

     
  • Fabien Cazenave (kaze)

    • assigned_to: nobody --> fabiwan
     
  • Fabien Cazenave (kaze)

    Thanks for the pointer. GetCurrentEditor().wrapWidth is not set at startup time (rev.214), so this issue should be solved... hopefully.

    Please attach a test file (html) to this bug ticket: click on the "add file" text at the bottom of this page, and an upload form will show up.

    -- kazé

     
  • Fabien Cazenave (kaze)

    @wintogreen> this is unrelated, but could you review the Japanese langpack please?
    We have absolutely no feedback on this langpack, and we don't know if the translation is correct or not. :-/

    -- kazé

     
  • Anonymous

    Anonymous - 2010-03-01

    There is no "add file" text shown to me -- it must be something you (dev) but not I (ordinary human) can see. So, I uploaded an HTML test file in bug 2960957. It contains just one paragraph in Japanese, about 150 characters in length. The paragraph is currently unwrapped (one long line), and if you open it with Kompozer, edit it in any way and save it, it will break the paragraph into multiple lines.

    I'm not a native speaker of Japanese, but I'll be happy to look at the Japanese language pack. If I notice anything that's obviously wrong even to me, I'll let you know.

     
  • Zhang Weiwu

    Zhang Weiwu - 2010-03-01

    I offer to check both Traditional and Simplified Chinese language pack in case you also need , as I am native to both, but I am a novice user, instruction of what should I do in order to test them on typical Ubuntu 9.10 or Windows environment must be available. Thanks:)

     
  • Anonymous

    Anonymous - 2010-03-05

    Testing with 0.8b3.en-US.win32 and 0.8b3.ja.win32 zip: this is now working PERFECTLY for me with editor.htmlWrapColumn set to 9999. If it's set to 0, however, long lines still get wrapped at 72 (?) characters.

     
  • Fabien Cazenave (kaze)

    hum, strange. We'll set this pref to 32767 for the next release.
    I'll see if I can't find any better way to disable the line wrapping.

    zhangweiwu > your input on the Chinese locales will be appreciated, of course! Basically, it's just about checking that there's no obvious mistake in the Chinese translations. These locales are 99.99% identical across all platforms, so checking this translation on your favorite platform (either Windows or Ubuntu) will be fine.

     
  • ykawara

    ykawara - 2010-12-06

    I remember I reported this bug a while ago, although I lost track of the bug number... I am sad this is still not fixed. What's the point in having the UI translated to Japanese if sites built with Kompozer will show with unwanted spaces?

     
  • ykawara

    ykawara - 2010-12-06

    kompozer-0.8b3.ja.gcc4.2-i686 here,
    I noticed that editor.htmlWrapColumn is set to 0 by default and that produces the bug; however, by setting it to 9999 as suggested by wintogreen the problem seems solved. But what if there was a Japanese text with 9999 characters? What's the biggest value you can put for editor.htmlWrapColumn?

     
  • ykawara

    ykawara - 2010-12-06

    For people having trouble like this, you can download AboutConfig-20091204.xpi from http://addons.kompozer.net/xpi/ (and install it with tools>add-ons), then edit the editor.htmlWrapColumn value through tools>about:config

     
  • ykawara

    ykawara - 2010-12-06

    By the way, I have to say that this bug happens only when Firefox is used to view a page created with Kompozer... Internet Explorer doesn't line wrap Japanese text even if it's line wrapped in the source code.

     
  • ykawara

    ykawara - 2010-12-06

    I had reported this bug to the Firefox team as well : https://bugzilla.mozilla.org/show_bug.cgi?id=535485

    I was pointed to this CSS draft at the W3C : http://dev.w3.org/csswg/css3-text/#line-break-transform
    I suspect IE to be implementing it, and Firefox not to be doing so because it's still a draft...

    Of course, word wrapped source is nicer for editing, so maybe you should turn line wrap back on when/if the draft makes it to the real standard... And then look at how Firefox implemented it to word wrap the source nicely as well.
    But until then, yes, turning off line wrap for languages with no spaces might be a better idea...

     
  • Zhang Weiwu

    Zhang Weiwu - 2011-07-15
    • summary: show-stopper bug for Asian users --> line-wrap in source HTML creasts unwanted spaces
     
  • ykawara

    ykawara - 2011-08-10

    I don't understand... I think I was using 0.8b3 (20100228) and someone told me a way to have this problem solved, and it worked, but since I am on a new install, I am back with the same problem...

     
  • Zhang Weiwu

    Zhang Weiwu - 2011-08-10

    Hi. you posted your solution on 2010-12-06 03:35:38 UTC and I followed your solution to have made my setup worked.

     
  • ykawara

    ykawara - 2011-08-10

    Oh!
    Thanks for pointing it out. I had forgotten about that 9999 value.
    I was looking into about:conf and wondered "Hey, it's set to 0 but still not working!"

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.