【发布时间】:2023-03-30 05:16:01
【问题描述】:
我正在尝试使用 Wikipedia 的 MediaWiki 解析器将 Wikipedia 标记文本解析为 HTML。 我在这里浏览了手册 - https://www.mediawiki.org/wiki/Manual:Parser.php 但是,由于我对 PHP 完全陌生,我无法编写测试脚本,
这是我想要解析并转换为 HTML 的示例输入:
Shakespeare's sonnets
==Characters==
When analysed as characters, the subjects of the sonnets are usually referred
to as the Fair Youth, the Rival Poet, and the Dark Lady. The speaker expresses
admiration for the Fair Youth's beauty, and later has an affair with the Dark
Lady. It is not known whether the poems and their characters are fiction or
autobiographical; scholars who find the sonnets to be autobiographical, notably
[[A. L. Rowse]], have attempted to identify the characters with historical
individuals.
【问题讨论】:
-
我用这个项目来解析code.google.com/p/gwtwiki这个项目给了我HTML输出,但保留了超链接和一些我希望删除的标签,所以我必须为它写一个洗涤器但是文档mediawiki 解析器声明它定义了函数来获得我需要的东西,所以我希望使用它..而且它是维基百科的官方解析器
标签: php parsing mediawiki wikipedia