我经常从客户端获取文本,并希望快速格式化带有html标签的文本,并将每个文本行包装为指定的字符数。我刚刚安装了Sublime Text 2,它非常好,但我真正想做的事情之一我不明白。Sublime Text 2 and Emmet and wrapping lines
我想要采取长段落,将段落换成段落p标记,然后换行以便它们不会跑出屏幕。所以这里是我在做什么:
从我的客户端复制并粘贴文本到编辑器(本例为2段)。
选择文本。
使用Emmet,输入“p *”,将p标签放在每个段落的开头,并在每个段落的末尾放置/ p。
选择文本。
单击Alt Q以包装文本。
文字环绕但它损坏,因为从/ p标记的开度角括号“<”被附加到每个行的开始和开口角撑架从/ p标签丢失。
<p>Our swimming lessons run on a perpetual monthly enrollment system,
<making year-round lessons affordable and convenient. Our online
<registration system allows you to sign up at your convenience and
<monitor your account details easily./p>
<p>Our highly trained swim instructors teach our unique, proven
<curriculum in stages, encouraging swimmers to master the fundamentals
<of every important swimming skill. We continuously encourage
<progression and advancement as each swimmer becomes more confident in
<the water. Our program blends important water safety skills, buoyancy
<principles and correct stroke technique./p>
帮助!我究竟做错了什么?
是的,这有效。谢谢。我注意到的一件事是,如果段落之间没有空行,那么Alt Q将它们组合在一起。另外,在序列结尾处,段落之间会丢失空行。是否有任何编辑器提示处理添加或删除空行? – user2250113
@ user2250113 - 是的,需要一个空行来划定段落 - 我不认为有任何解决方法。如果我的答案帮助解决了您的问题,请随时点击旁边的复选标记以将其选为答案。它会将您的问题标记为已解决,并协助将来可能有相同或类似问题的网站访问者。谢谢! – MattDMo
我选择了您的答案来解决我的问题。感谢您及时的回复。我能够添加快捷方式,这也将有所帮助。 – user2250113