首页 > 解决方案 > 如何突出显示基于 html 的时事通讯中的特定单词?

问题描述

我想问您以下问题:我有一个基于 html 的时事通讯,该时事通讯链接到自动添加的文章。这些文章显示为:

Title:
Article 1 pub date
description
Article 2 pub date
description and so on

我想在文章描述或标题中突出显示某些词。例如“测试”。(或者换句话说,添加一个规则,以确保每次文章都加载到时事通讯中,并且如果该特定单词出现在其中一篇文章中,它会被突出显示。我希望你能帮助我一些关于我在哪里的提示应该将某些代码放在下面的部分或其他地方(html代码有 and 和 )。

谢谢一堆。

确保文章加载的部分如下:


<!-- This part generates the articles -->
    <xsl:template match="story" mode="article">
    <xsl:if test="related">
            <tr>
                <td><a><xsl:attribute name="name"><xsl:value-of select="storyid"/></xsl:attribute></a></td>
            </tr>
            <tr>
                <td style="font-size: 9pt; text-decoration: none;"><a><xsl:attribute name="href"><xsl:value-of select="weburl"/></xsl:attribute><xsl:value-of select="titel"/></a> - <xsl:value-of select="source_lang"/>
<xsl:if test="type='WEBARTICLE' and weburl!=''"> online</xsl:if></td>
            </tr>
            <xsl:if test="snippet!=''">

            <tr>
                <td style="line-height: 5px;"><xsl:text disable-output-escaping="yes"><![CDATA[&nbsp;]]></xsl:text></td>
            </tr>
                         <tr><td style="font-size: 9pt; text-decoration: none;">
                              ...<xsl:apply-templates select="snippet"/>...</td>
            </tr>
                      </xsl:if>

标签: htmlhighlightnewsletter

解决方案


推荐阅读