Skip to content

Commit accb57f

Browse files
jirka.pinkas@gmail.comjirka.pinkas@gmail.com
authored andcommitted
added titleCdata and descriptionCdata helper methods to RssItemBuilder which produce content surrounded with CDATA
1 parent 6002436 commit accb57f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/main/java/cz/jiripinkas/jsitemapgenerator/WebPage.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,17 @@ public RssItemBuilder title(String title) {
318318
return this;
319319
}
320320

321+
/**
322+
* Sets Title surrounded by CDATA
323+
*
324+
* @param title Title
325+
* @return this
326+
*/
327+
public RssItemBuilder titleCdata(String title) {
328+
webPage.setName("<![CDATA[ " + title + " ]]>");
329+
return this;
330+
}
331+
321332
/**
322333
* Sets Description
323334
*
@@ -329,6 +340,19 @@ public RssItemBuilder description(String description) {
329340
return this;
330341
}
331342

343+
344+
/**
345+
* Sets Description surrounded by CDATA
346+
*
347+
* @param description Description
348+
* @return this
349+
*/
350+
public RssItemBuilder descriptionCdata(String description) {
351+
webPage.setShortDescription("<![CDATA[ " + description + " ]]>");
352+
return this;
353+
}
354+
355+
332356
/**
333357
* Sets Name
334358
*

0 commit comments

Comments
 (0)