有没有一种好方法可以将整个文档中的大写 html 标签更改为小写?
所以,我已经交付了一堆我应该设置样式的标记页面。问题是标签都是大写的,即使 doctype 将其声明为 xhtml。这不仅丑陋、伤眼睛,而且也是错误的,不是吗?
有没有好的方法,也许是 coda(我喜欢的工具)、插件或在线服务可以为我做到这一点?或者你可以在 coda 中进行正则表达式搜索和替换吗?如果可以,怎么做? (我将是第一个承认正则表达式不是我的 Java 杯子的人。)
So, I've got a bunch of markup-pages delivered that I am supposed to style. Problem is that tags are all in uppercase, even though the doctype declares it as xhtml. Not only is it ugly and hurting my eyes, it's also wrong, isn't it?
Is there a good way, perhaps a coda (my preferred tool), plug-in, or online service that can do this for me? Or can you do a regexp search-and-replace in coda, and if so, how? (I'll be the first to admit that regexp isn't my cup o'Java.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试弄清楚如何在 RegExp 中执行此操作(有点像
/<([^>]*)>/g
有点过于简单,但它是一个开始)但这仍然存在问题。 Coda 的 RegExp 只是查找和替换,所以我认为您无法在用 Coda 替换之前对找到的每个项目执行“toLowerCase()” - 您必须使用某种脚本语言。另一个选择是下载 W3C 的 Tidy 应用程序,我相信它有“转大写”和“转小写”选项,尽管我没有使用过它。它在这里:http://tidy.sourceforge.net/#binaries(尚未更新一会儿)
You could try figuring out how to do it in RegExp (something a little like
/<([^>]*)>/g
would be a bit too simplistic, but its a start) but that still presents problems. Coda's RegExp just does find-and-replace so I don't think you'd be able to do a "toLowerCase()" on each item found before replacing with Coda - you'd have to use some scripting language.Another option is to download the W3C's Tidy application which I believe has "to uppercase" and "to lowercase" options, though I've not used it. It's here: http://tidy.sourceforge.net/#binaries (hasn't been updated in a while)