Emmet - Wrap with Abbreviation - 表示包装文本的标记,即{原始文本} [英] Emmet - Wrap with Abbreviation - Token that represents the wrapped text i.e. {original text}

查看:23
本文介绍了Emmet - Wrap with Abbreviation - 表示包装文本的标记,即{原始文本}的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试尽可能懒惰地将 URL 列表转换为 HTML 链接:

I'm attempting to convert a list of URLs into HTML links as lazily as possible:

www.annaandsally.com.au
www.babylush.com.au
www.babysgotstyle.com.au
... etc

使用 wrap 的缩写,我想做这样的事情:a[href="http://${1}/"]*

Using wrap in abbreviation, I'd like to do something like: a[href="http://${1}/"]*

扩展的缩写将导致:

<a href="http://www.annaandsally.com.au/">www.annaandsally.com.au</a>
<a href="http://www.babylush.com.au/">www.babylush.com.au</a>
<a href="http://www.babysgotstyle.com.au/">www.babysgotstyle.com.au</a>
... etc

拼图的缺失部分是一个缩写标记,它代表被包装的文本.

知道这是否可以做到吗?

Any idea if this can be done?

推荐答案

来自 Emmet 的 Sergey 非常友好地为我指明了正确的方向.$# 标记包含原始内容:

Sergey from Emmet was kind enough to point me in the right direction. The $# token contains the original content:

a[href="http://$#/"]*>{$#}

通过将 $# 指定为 href 属性,原始内容不再包装",必须通过 {$#} 重新插入代码>.

By specifying $# as the href attribute, the original content is no longer 'wrapped' and must be be reinserted via {$#}.

http://docs.emmet.io/actions/wrap-with-abbreviation/#controlling-output-position

这篇关于Emmet - Wrap with Abbreviation - 表示包装文本的标记,即{原始文本}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆