Req Visual code folding (linefeeds & tabs) for xml files inserted per </> button.
#1
I have been wondering for a long time why xml files posted here (</> button) look if not ugly then difficult to read; specifically, why they do not observe syntax-related code folding. Until I posted my first xml file. It turns out that xml files inserted per </> do not observe code folding. In fact, you cannot even correct it per hand-editing yourself.

I am aware of the fact that xml files are machine readable irrespective of their visual code folding. But we are humans not machines. To make a xml file humanely readable you have to add line feeds & tabs where the code implies so.

In the final analysis look at the xml files shipped with Kodi. They are all visually code folded.

BTW (I am curious): How does </> insert python files, where (unlike xml files) linefeeds + tabs matter for machine readability?
Reply
#2
Are you specifying which language to use?
Does #25 help...

Image
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#3
Testing: include xml file in post
 
xml:

<?xml version="1.0" encoding="UTF-8"?>
<settings>
<setting></setting>
<setting>
<item></item>
</setting>
</settings>

I clicked </> and selected xml and then inserted a pre-built arbitrary xml file coded in notepadd++ beforehand. And yes, the result was a beautifylly code folded xml file. When however I added IN THIS MINIMAL EDITOR an additional, equally artibrary sub-sub-tag <item></item> all folding order got lost, as you see in the example above.

I then created the exact same structure in notepad++ then inserted it in this minimal editor. Now everything looks fine.

xml:

<?xml version="1.0" encoding="UTF-8"?>
<settings>
    <setting></setting>
    <setting>
        <item></item>
        <item></item>
    </setting>
</settings>

In conclusion, thanks @Karellen for the help, I now know how to input xml files code-folded correctly. However... Shouldn't this minimal editor do this on its own rather than expecting to receive a file previously coded in a text editor?
Reply
#4
P.S.
A quick browsing of this forum showed that well over 50% of all posts including xml files are not correctly code folded. Indeed, as the examples posted above prove, they are not code folded at all. All code is aligned at column 1 left.
Reply

Logout Mark Read Team Forum Stats Members Help
Visual code folding (linefeeds & tabs) for xml files inserted per </> button.0