V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
sciel
V2EX  ›  Go 编程语言

golang 有什么好用的工具使 字符串转为带 html 标签的字符串?

  •  
  •   sciel · 2022-04-11 14:07:30 +08:00 · 978 次点击
    这是一个创建于 747 天前的主题,其中的信息可能已经有所发展或是发生改变。
    4 条回复    2022-04-12 09:05:53 +08:00
    linglin0924
        1
    linglin0924  
       2022-04-11 14:21:34 +08:00
    hello 转换成 <a> hello </a>?

    html 标签就那几个,自己手动拼接呗
    sciel
        2
    sciel  
    OP
       2022-04-11 14:39:12 +08:00
    @linglin0924 也对,没几个,自己手动切一下加上算了。。
    raaaaaar
        3
    raaaaaar  
       2022-04-11 21:14:28 +08:00
    直接搓一个轮子?
    sciel
        4
    sciel  
    OP
       2022-04-12 09:05:53 +08:00 via iPhone
    @raaaaaar 我的需求简单 回车换行切开,然后前后加个 p 标签,三行代码……
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2811 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 10:08 · PVG 18:08 · LAX 03:08 · JFK 06:08
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.