我使用PHP Markdown(版本1.0.1n,更新2009年10月)顯示保存在降價格式的數據庫中的文本。我遇到了一個奇怪的問題,它將每個條目的最後一部分標記爲H3。但是,當我搜索markdown.php文件時,沒有H3的單個實例。PHP降價的內容最後一塊標註爲H3
這裏是從我的數據庫的文字兩個部分組成:
Since its launch, major CPG brands, endemic as well as non-endemic, have flocked to retail websites to reach consumers deep in the purchase funnel through shopping media. In this session, you will hear about:
- The prioritization of shopping media for CPG brands.
- A case study of brands on Target.com on how this retailer (and others) have introduced a new channel for brand marketers to engage consumers where they are making the majority of purchase decisions: online.
- How CPG brands are leveraging real-time data from shopping media to capture consumer insights and market trends.
在這其中,它被正確標記的李項目,但最終李裏面它標記的實際文本爲H3。
Beyond the actual money she saves, this consumer is both empowered and psychologically gratified by getting the best value on her everyday purchases. It is essential for both marketers and retailers to focus on what motivates and activates this consumer.
Diane Oshin will share insights on what influences her shopping behavior and then identify specific tools that activate her to buy.
在這一個中,以Diane Oshin開頭的整個段落被標記爲H3。
這裏是非常奇怪的事情:當我做了查看源代碼,兩者都被正確標記;只有在使用Inspect Element時纔會看到H3。然而,它在實際顯示明顯,正在應用的H3標籤:
例如1
例如2
誰能幫助我嗎?
更新
每下方的評論,我看了用於h標籤的實例。我發現了這些功能,但不知道這是否是可能導致問題的原因。它們是整個文件中唯一可以創建任何類型標題標籤的地方。
function doHeaders($text) {
# Setext-style headers:
# Header 1
# ========
#
# Header 2
# --------
#
$text = preg_replace_callback('{ ^(.+?)[ ]*\n(=+|-+)[ ]*\n+ }mx',
array(&$this, '_doHeaders_callback_setext'), $text);
# atx-style headers:
# # Header 1
# ## Header 2
# ## Header 2 with closing hashes ##
# ...
# ###### Header 6
#
$text = preg_replace_callback('{
^(\#{1,6}) # $1 = string of #\'s
[ ]*
(.+?) # $2 = Header text
[ ]*
\#* # optional closing #\'s (not counted)
\n+
}xm',
array(&$this, '_doHeaders_callback_atx'), $text);
return $text;
}
function _doHeaders_callback_setext($matches) {
# Terrible hack to check we haven't found an empty list item.
if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1]))
return $matches[0];
$level = $matches[2]{0} == '=' ? 1 : 2;
$block = "<h$level>".$this->runSpanGamut($matches[1])."</h$level>";
return "\n" . $this->hashBlock($block) . "\n\n";
}
function _doHeaders_callback_atx($matches) {
$level = strlen($matches[1]);
$block = "<h$level>".$this->runSpanGamut($matches[2])."</h$level>";
return "\n" . $this->hashBlock($block) . "\n\n";
}
你試過獲得項目的開發版本?你可以得到它[通過混帳(http://git.michelf.com/php-markdown/)。 – Blender 2011-06-14 15:56:25
尋找一個作爲'3'的實例可能會根據解析器狀態添加。 – hakre 2011-06-14 15:59:32
@hakre - 我正在更新原始帖子; H標籤很奇怪... – EmmyS 2011-06-14 16:15:14