lorenzos / ZenCodingNetBeansPlugin

Zen Coding plugin for NetBeans
233 stars 57 forks source link

Don't change tag to lowercase #9

Closed yesmeck closed 12 years ago

yesmeck commented 12 years ago

Example:

config>Modules

Expect:

<config>
    <Modules>
    </Modules>
</config>

But output:

<config>
    <modules>
    </modules>
</config>

I use zendconding write some xml files.So I really need some tags uppercase.

lorenzos commented 12 years ago

This is a problem with the official Zen Coding library. You can test it here: http://zen-coding.ru/textarea/ (use TAB to expand abbreviations). In fact, this is a real problem for XML files.

I use the official Zen Coding library in my plugin, not a rewritten one. So, try to open an issue here: http://code.google.com/p/zen-coding/issues/list If you don't have or don't want to create a Google Code account, I can open the issue for you.

As soon as they correct this and release the fix, I will update my plugin too.

yesmeck commented 12 years ago

OK,I submit a issue by myself. http://code.google.com/p/zen-coding/issues/detail?id=301

yesmeck commented 12 years ago

It seems tag case output can be controlled in this line https://github.com/lorenzos/ZenCodingNetBeansPlugin/blob/master/src/ru/zencoding/zencoding-java.js#L1658

http://code.google.com/p/zen-coding/issues/detail?id=301#c1

lorenzos commented 12 years ago

Ok, so I reopen this issue. Now I have to decide if let the user choose if use lowercase profile or not (difficult, because it need an option dialog or something in the UI), or disable the lowercase profile for all future releases...

lorenzos commented 12 years ago

However, I think there is no reason to force lowercase. Users usually type abbreviations in lowercase, so if they type an uppercase character, it means they want it uppercase in the tag. So I think I will not create any UI for customization: simply I will disable this automatic lowercase conversion.

lorenzos commented 12 years ago

Solved in the last commit.

Now you can write all combination of lowercase and uppercase you want, for example:

UL>(LI>img[SRC="image.jpg"])*3

Expands to:

<UL>
    <LI><img src="" alt="" SRC="image.jpg" /></LI>
    <LI><img src="" alt="" SRC="image.jpg" /></LI>
    <LI><img src="" alt="" SRC="image.jpg" /></LI>
</UL>

I have not created a master release for this fix. I will include it in future releases. So, for the moment, you have to download the updated .nbm file directly from the source tree, clicking here: https://github.com/lorenzos/ZenCodingNetBeansPlugin/raw/master/build/org-lorenzos-zencoding.nbm

Try it and let me know if I can close this issue!

yesmeck commented 12 years ago

Oh!Thanks man!!!!It work well!