Giter Club home page Giter Club logo

happy-birthday-today's Introduction

happy-birthday-today's People

Contributors

w1ndys avatar

Watchers

 avatar

happy-birthday-today's Issues

更新日志🆕✨

支持插入HTML

在使用多行字符串处理HTML时,缩进和换行会影响HTML的渲染效果,导致标签之间出现空格。为了避免这种情况,可以确保多行字符串的每一行紧密相连,没有多余的空格或换行。以下是两种正确的方法来处理嵌入HTML的情况:

方法一:单行字符串

如果HTML代码较短,可以使用单行字符串处理:

- name: "<span style='color: red;'>W</span><span style='color: orange;'>1</span><span style='color: yellow;'>n</span><span style='color: green;'>d</span><span style='color: blue;'>y</span><span style='color: purple;'>s</span>"
  birthday: "2005-05-21"

方法二:多行字符串(避免空格和换行)

如果HTML代码较长,需要使用多行字符串,可以采用>符号以避免空格和换行带来的问题:

- name: >
    <span style='color: red;'>W</span><span style='color: orange;'>1</span><span style='color: yellow;'>n</span><span style='color: green;'>d</span><span style='color: blue;'>y</span><span style='color: purple;'>s</span>
  birthday: "2005-05-21"

这样可以确保HTML代码在YAML中正确嵌入且不会因多行字符串的换行或缩进导致多余空格。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.