Version: (using Devel) Compiler: gcc 4.2.3 OS: Linux Installed from: Compiled sources XML file is sometimes not correctly intended (using Tools - Align command). For example look at following file: <xml> <!-- <in-comment> </in-comment> --> <element> </element> </xml> <element> is not intended correctly. Try to remove <in-comment>, </in-comment> or both and do Tools - Align. Every time intendation will change. Tested with katepart in kde 3.5.9 and 4.1.67.
Bug still exists. KDE 4.6.00, Kate 3.6.0
Milian, do you plan to do something about it? Fabian and Jiri: The xml indenter can be found in e.g. /usr/share/kde4/apps/katepart/script/xml.js, or in a similar location on your system. It's plain javascript, if you want, you can try to improve it and contribute a better version! See: http://docs.kde.org/stable/en/kdebase-runtime/kate/advanced-editing-tools-scripting.html
I'd like to fix it eventually but I simply don't have enough time right now for it - sorry. If someone else could work on it I'd appreciate it and would gladly give a hand.
We have the indenters as javascript for the reason that users can help to maintain them. If you want to provide a patch, please reopen, else this stays closed.
Git commit b79d22f6a32cb9db8bab78447f3b984a97729e0b by Gerald Senarclens de Grancy. Committed on 16/04/2013 at 01:41. Pushed by geralds into branch 'master'. Rewrote xml indenter and added a small test-suite removed many of the really complicated regular expressions and replaced them using the nice .isComment, .isCode, ... functions also works properly on aligning etc. REVIEW: 110018 M +129 -122 part/script/data/indentation/xml.js M +17 -1 part/script/data/libraries/string.js A +1 -0 tests/data/indent/xml/.kateconfig A +2 -0 tests/data/indent/xml/arguments1/expected A +3 -0 tests/data/indent/xml/arguments1/input.js A +1 -0 tests/data/indent/xml/arguments1/origin A +3 -0 tests/data/indent/xml/arguments2/expected A +3 -0 tests/data/indent/xml/arguments2/input.js A +2 -0 tests/data/indent/xml/arguments2/origin A +3 -0 tests/data/indent/xml/arguments3/expected A +3 -0 tests/data/indent/xml/arguments3/input.js A +2 -0 tests/data/indent/xml/arguments3/origin A +3 -0 tests/data/indent/xml/arguments4/expected A +3 -0 tests/data/indent/xml/arguments4/input.js A +2 -0 tests/data/indent/xml/arguments4/origin A +3 -0 tests/data/indent/xml/closing1/expected A +3 -0 tests/data/indent/xml/closing1/input.js A +2 -0 tests/data/indent/xml/closing1/origin A +3 -0 tests/data/indent/xml/closing2/expected A +3 -0 tests/data/indent/xml/closing2/input.js A +2 -0 tests/data/indent/xml/closing2/origin A +3 -0 tests/data/indent/xml/closing3/expected A +4 -0 tests/data/indent/xml/closing3/input.js A +2 -0 tests/data/indent/xml/closing3/origin A +1 -0 tests/data/indent/xml/comment1/README A +3 -0 tests/data/indent/xml/comment1/expected A +3 -0 tests/data/indent/xml/comment1/input.js A +2 -0 tests/data/indent/xml/comment1/origin A +4 -0 tests/data/indent/xml/comment2/expected A +11 -0 tests/data/indent/xml/comment2/input.js A +4 -0 tests/data/indent/xml/comment2/origin A +3 -0 tests/data/indent/xml/opening1/expected A +4 -0 tests/data/indent/xml/opening1/input.js A +1 -0 tests/data/indent/xml/opening1/origin A +2 -0 tests/data/indent/xml/self_closing1/expected A +3 -0 tests/data/indent/xml/self_closing1/input.js A +1 -0 tests/data/indent/xml/self_closing1/origin A +2 -0 tests/data/indent/xml/text1/expected A +3 -0 tests/data/indent/xml/text1/input.js A +1 -0 tests/data/indent/xml/text1/origin A +2 -0 tests/data/indent/xml/text2/expected A +3 -0 tests/data/indent/xml/text2/input.js A +1 -0 tests/data/indent/xml/text2/origin A +35 -0 tests/data/indent/xml/xhtml1/expected A +66 -0 tests/data/indent/xml/xhtml1/input.js A +1 -0 tests/data/indent/xml/xhtml1/origin M +12 -0 tests/indenttest.cpp M +3 -0 tests/indenttest.h http://commits.kde.org/kate/b79d22f6a32cb9db8bab78447f3b984a97729e0b