Permalink
Show file tree
Hide file tree
5 changes: 5 additions & 0 deletions
5
...form-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-rss/pom.xml
44 changes: 42 additions & 2 deletions
44
...rm-rendering-macro-rss/src/main/java/org/xwiki/rendering/internal/macro/rss/RssMacro.java
6 changes: 3 additions & 3 deletions
6
...orm-rendering-macros/xwiki-platform-rendering-macro-rss/src/test/resources/macrorss1.test
4 changes: 2 additions & 2 deletions
4
...orm-rendering-macros/xwiki-platform-rendering-macro-rss/src/test/resources/macrorss2.test
6 changes: 3 additions & 3 deletions
6
...orm-rendering-macros/xwiki-platform-rendering-macro-rss/src/test/resources/macrorss3.test
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
XWIKI-19671: Filter the feed's content in the RSS macro
- Loading branch information
Showing
7 changed files
with
116 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...platform-rendering-macros/xwiki-platform-rendering-macro-rss/src/test/resources/feed3.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <?xml version="1.0"?> | ||
|
|
||
| <!-- | ||
| * See the NOTICE file distributed with this work for additional | ||
| * information regarding copyright ownership. | ||
| * | ||
| * This is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU Lesser General Public License as | ||
| * published by the Free Software Foundation; either version 2.1 of | ||
| * the License, or (at your option) any later version. | ||
| * | ||
| * This software is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with this software; if not, write to the Free | ||
| * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
| * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
| --> | ||
|
|
||
| <rss version="2.0"> | ||
| <channel> | ||
| <title>Test Feed 3</title> | ||
| <link>http://localhost/feed.xml</link> | ||
| <description>A pseudo-feed to test the RSS macro</description> | ||
| <item> | ||
| <title>Item1</title> | ||
| <link>http://localhost/blog/item1</link> | ||
| <description>An item with <a href="javascript:alert(1)">dangerous</a> <b>HTML</b>markup.</description> | ||
| </item> | ||
| </channel> | ||
| </rss> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...orm-rendering-macros/xwiki-platform-rendering-macro-rss/src/test/resources/macrorss4.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| .runTransformations | ||
| .#----------------------------------------------------- | ||
| .input|xwiki/2.0 | ||
| .# Verify HTML filtering works. | ||
| .#----------------------------------------------------- | ||
| {{testrss feed="file://feed3.xml" content="true" count="2" decoration="false" encoding="UTF-8"/}} | ||
| .#----------------------------------------------------- | ||
| .expect|event/1.0 | ||
| .#----------------------------------------------------- | ||
| beginDocument | ||
| beginMacroMarkerStandalone [testrss] [feed=file://feed3.xml|content=true|count=2|decoration=false|encoding=UTF-8] | ||
| beginGroup [[class]=[rssfeed]] | ||
| beginParagraph [[class]=[rssitemtitle]] | ||
| beginLink [Typed = [true] Type = [url] Reference = [http://localhost/blog/item1]] [true] | ||
| onWord [Item1] | ||
| endLink [Typed = [true] Type = [url] Reference = [http://localhost/blog/item1]] [true] | ||
| endParagraph [[class]=[rssitemtitle]] | ||
| beginGroup [[class]=[rssitemdescription]] | ||
| onRawText [<p>An item with <a>dangerous</a> <b>HTML</b>markup.</p>] [html/5.0] | ||
| endGroup [[class]=[rssitemdescription]] | ||
| endGroup [[class]=[rssfeed]] | ||
| endMacroMarkerStandalone [testrss] [feed=file://feed3.xml|content=true|count=2|decoration=false|encoding=UTF-8] | ||
| endDocument | ||
| .#----------------------------------------------------- | ||
| .expect|xhtml/1.0 | ||
| .#----------------------------------------------------- | ||
| <div class="rssfeed"><p class="rssitemtitle"><span class="wikiexternallink"><a class="wikimodel-freestanding" href="http://localhost/blog/item1">Item1</a></span></p><div class="rssitemdescription"><p>An item with <a>dangerous</a> <b>HTML</b>markup.</p></div></div> |