136 public final DocPath pathToRoot;
137
138 /**
139 * Platform-independent path from the current or the
140 * destination directory to the file getting generated.
141 * Used when creating the file.
142 */
143 public final DocPath path;
144
145 /**
146 * Name of the file getting generated. If the file getting generated is
147 * "java/lang/Object.html", then the filename is "Object.html".
148 */
149 public final DocPath filename;
150
151 /**
152 * The global configuration information for this run.
153 */
154 public final HtmlConfiguration configuration;
155
156 protected final Utils utils;
157
158 protected final Contents contents;
159
160 protected final Messages messages;
161
162 protected final Resources resources;
163
164 protected final Links links;
165
166 protected final DocPaths docPaths;
167
168 /**
169 * To check whether annotation heading is printed or not.
170 */
171 protected boolean printedAnnotationHeading = false;
172
173 /**
174 * To check whether annotation field heading is printed or not.
175 */
191 protected String winTitle;
192
193 protected Script mainBodyScript;
194
195 /**
196 * A table of the anchors used for at-index and related tags,
197 * so that they can be made unique by appending a suitable suffix.
198 * (Ideally, javadoc should be tracking all id's generated in a file
199 * to avoid generating duplicates.)
200 */
201 Map<String, Integer> indexAnchorTable = new HashMap<>();
202
203 /**
204 * Constructor to construct the HtmlStandardWriter object.
205 *
206 * @param configuration the configuration for this doclet
207 * @param path the file to be generated.
208 */
209 public HtmlDocletWriter(HtmlConfiguration configuration, DocPath path) {
210 this.configuration = configuration;
211 this.contents = configuration.contents;
212 this.messages = configuration.messages;
213 this.resources = configuration.resources;
214 this.links = new Links(path);
215 this.utils = configuration.utils;
216 this.path = path;
217 this.pathToRoot = path.parent().invert();
218 this.filename = path.basename();
219 this.docPaths = configuration.docPaths;
220 this.mainBodyScript = new Script();
221
222 messages.notice("doclet.Generating_0",
223 DocFile.createFileForOutput(configuration, path).getPath());
224 }
225
226 /**
227 * Replace {@docRoot} tag used in options that accept HTML text, such
228 * as -header, -footer, -top and -bottom, and when converting a relative
229 * HREF where commentTagsToString inserts a {@docRoot} where one was
230 * missing. (Also see DocRootTaglet for {@docRoot} tags in doc
242 * Note: This doc comment was written with '&#064;' representing '@'
243 * to prevent the inline tag from being interpreted.
244 */
245 public String replaceDocRootDir(String htmlstr) {
246 // Return if no inline tags exist
247 int index = htmlstr.indexOf("{@");
248 if (index < 0) {
249 return htmlstr;
250 }
251 Matcher docrootMatcher = docrootPattern.matcher(htmlstr);
252 if (!docrootMatcher.find()) {
253 return htmlstr;
254 }
255 StringBuilder buf = new StringBuilder();
256 int prevEnd = 0;
257 do {
258 int match = docrootMatcher.start();
259 // append htmlstr up to start of next {@docroot}
260 buf.append(htmlstr.substring(prevEnd, match));
261 prevEnd = docrootMatcher.end();
262 if (configuration.docrootparent.length() > 0 && htmlstr.startsWith("/..", prevEnd)) {
263 // Insert the absolute link if {@docRoot} is followed by "/..".
264 buf.append(configuration.docrootparent);
265 prevEnd += 3;
266 } else {
267 // Insert relative path where {@docRoot} was located
268 buf.append(pathToRoot.isEmpty() ? "." : pathToRoot.getPath());
269 }
270 // Append slash if next character is not a slash
271 if (prevEnd < htmlstr.length() && htmlstr.charAt(prevEnd) != '/') {
272 buf.append('/');
273 }
274 } while (docrootMatcher.find());
275 buf.append(htmlstr.substring(prevEnd));
276 return buf.toString();
277 }
278 //where:
279 // Note: {@docRoot} is not case sensitive when passed in w/command line option:
280 private static final Pattern docrootPattern =
281 Pattern.compile(Pattern.quote("{@docroot}"), Pattern.CASE_INSENSITIVE);
282
283 /**
284 * Get the script to show or hide the All classes link.
285 *
286 * @param id id of the element to show or hide
287 * @return a content tree for the script
288 */
289 public Content getAllClassesLinkScript(String id) {
290 Script script = new Script("<!--\n" +
291 " allClassesLink = document.getElementById(")
292 .appendStringLiteral(id)
293 .append(");\n" +
294 " if(window==top) {\n" +
295 " allClassesLink.style.display = \"block\";\n" +
296 " }\n" +
297 " else {\n" +
298 " allClassesLink.style.display = \"none\";\n" +
299 " }\n" +
322 if ((!intfacs.isEmpty()
323 && vmt.getImplementedMethods(method).isEmpty() == false)
324 || overriddenMethod != null) {
325 MethodWriterImpl.addImplementsInfo(this, method, dl);
326 if (overriddenMethod != null) {
327 MethodWriterImpl.addOverridden(this,
328 utils.overriddenType(method),
329 overriddenMethod,
330 dl);
331 }
332 }
333 }
334
335 /**
336 * Adds the tags information.
337 *
338 * @param e the Element for which the tags will be generated
339 * @param htmltree the documentation tree to which the tags will be added
340 */
341 protected void addTagsInfo(Element e, Content htmltree) {
342 if (configuration.nocomment) {
343 return;
344 }
345 Content dl = new HtmlTree(HtmlTag.DL);
346 if (utils.isExecutableElement(e) && !utils.isConstructor(e)) {
347 addMethodInfo((ExecutableElement)e, dl);
348 }
349 Content output = new ContentBuilder();
350 TagletWriter.genTagOutput(configuration.tagletManager, e,
351 configuration.tagletManager.getBlockTaglets(e),
352 getTagletWriterInstance(false), output);
353 dl.add(output);
354 htmltree.add(dl);
355 }
356
357 /**
358 * Check whether there are any tags for Serialization Overview
359 * section to be printed.
360 *
361 * @param field the VariableElement object to check for tags.
362 * @return true if there are tags to be printed else return false.
431 *
432 * @param metakeywords Array of String keywords for META tag. Each element
433 * of the array is assigned to a separate META tag.
434 * Pass in null for no array
435 * @param description the content for the description META tag.
436 * @param extraHeadContent any additional content to be included in the HEAD element
437 * @param localStylesheets local stylesheets to be included in the HEAD element
438 * @param body the body htmltree to be included in the document
439 * @throws DocFileIOException if there is a problem writing the file
440 */
441 public void printHtmlDocument(List<String> metakeywords,
442 String description,
443 Content extraHeadContent,
444 List<DocPath> localStylesheets,
445 Content body)
446 throws DocFileIOException {
447 Content htmlComment = contents.newPage;
448 List<DocPath> additionalStylesheets = configuration.getAdditionalStylesheets();
449 additionalStylesheets.addAll(localStylesheets);
450 Head head = new Head(path, configuration.docletVersion, configuration.startTime)
451 .setTimestamp(!configuration.notimestamp)
452 .setDescription(description)
453 .setGenerator(getGenerator(getClass()))
454 .setTitle(winTitle)
455 .setCharset(configuration.charset)
456 .addKeywords(metakeywords)
457 .setStylesheets(configuration.getMainStylesheet(), additionalStylesheets)
458 .setIndex(configuration.createindex, mainBodyScript)
459 .addContent(extraHeadContent);
460
461 Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body);
462 HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree);
463 htmlDocument.write(DocFile.createFileForOutput(configuration, path));
464 }
465
466 /**
467 * Get the window title.
468 *
469 * @param title the title string to construct the complete window title
470 * @return the window title string
471 */
472 public String getWindowTitle(String title) {
473 if (configuration.windowtitle.length() > 0) {
474 title += " (" + configuration.windowtitle + ")";
475 }
476 return title;
477 }
478
479 /**
480 * Get user specified header and the footer.
481 *
482 * @param header if true print the user provided header else print the
483 * user provided footer.
484 */
485 public Content getUserHeaderFooter(boolean header) {
486 String content;
487 if (header) {
488 content = replaceDocRootDir(configuration.header);
489 } else {
490 if (configuration.footer.length() != 0) {
491 content = replaceDocRootDir(configuration.footer);
492 } else {
493 content = replaceDocRootDir(configuration.header);
494 }
495 }
496 Content rawContent = new RawHtml(content);
497 return rawContent;
498 }
499
500 /**
501 * Adds the user specified top.
502 *
503 * @param htmlTree the content tree to which user specified top will be added
504 */
505 public void addTop(Content htmlTree) {
506 Content top = new RawHtml(replaceDocRootDir(configuration.top));
507 htmlTree.add(top);
508 }
509
510 /**
511 * Adds the user specified bottom.
512 *
513 * @param htmlTree the content tree to which user specified bottom will be added
514 */
515 public void addBottom(Content htmlTree) {
516 Content bottom = new RawHtml(replaceDocRootDir(configuration.bottom));
517 Content small = HtmlTree.SMALL(bottom);
518 Content p = HtmlTree.P(HtmlStyle.legalCopy, small);
519 htmlTree.add(p);
520 }
521
522 /**
523 * Get the overview tree link for the main tree.
524 *
525 * @param label the label for the link
526 * @return a content tree for the link
527 */
528 protected Content getNavLinkMainTree(String label) {
529 Content mainTreeContent = links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE),
530 new StringContent(label));
531 Content li = HtmlTree.LI(mainTreeContent);
532 return li;
533 }
534
535 /**
536 * Get table caption.
1242 * @param htmltree the documentation tree to which the comment tags will be added
1243 */
1244 private void addCommentTags(Element element, List<? extends DocTree> tags, boolean depr,
1245 boolean first, boolean inSummary, Content htmltree) {
1246 addCommentTags(element, null, tags, depr, first, inSummary, htmltree);
1247 }
1248
1249 /**
1250 * Adds the comment tags.
1251 *
1252 * @param element for which the comment tags will be generated
1253 * @param holderTag the block tag context for the inline tags
1254 * @param tags the first sentence tags for the doc
1255 * @param depr true if it is deprecated
1256 * @param first true if the first sentence tags should be added
1257 * @param inSummary true if the comment tags are added into the summary section
1258 * @param htmltree the documentation tree to which the comment tags will be added
1259 */
1260 private void addCommentTags(Element element, DocTree holderTag, List<? extends DocTree> tags, boolean depr,
1261 boolean first, boolean inSummary, Content htmltree) {
1262 if(configuration.nocomment){
1263 return;
1264 }
1265 Content div;
1266 Content result = commentTagsToContent(null, element, tags, first, inSummary);
1267 if (depr) {
1268 div = HtmlTree.DIV(HtmlStyle.deprecationComment, result);
1269 htmltree.add(div);
1270 }
1271 else {
1272 div = HtmlTree.DIV(HtmlStyle.block, result);
1273 htmltree.add(div);
1274 }
1275 if (tags.isEmpty()) {
1276 htmltree.add(Entity.NO_BREAK_SPACE);
1277 }
1278 }
1279
1280 boolean ignoreNonInlineTag(DocTree dtree) {
1281 Name name = null;
1282 if (dtree.getKind() == Kind.START_ELEMENT) {
1403 String quote;
1404 switch (node.getValueKind()) {
1405 case DOUBLE:
1406 quote = "\"";
1407 break;
1408 case SINGLE:
1409 quote = "\'";
1410 break;
1411 default:
1412 quote = "";
1413 break;
1414 }
1415 sb.append(quote);
1416 result.add(sb);
1417 Content docRootContent = new ContentBuilder();
1418
1419 boolean isHRef = inAnAtag() && node.getName().toString().equalsIgnoreCase("href");
1420 for (DocTree dt : node.getValue()) {
1421 if (utils.isText(dt) && isHRef) {
1422 String text = ((TextTree) dt).getBody();
1423 if (text.startsWith("/..") && !configuration.docrootparent.isEmpty()) {
1424 result.add(configuration.docrootparent);
1425 docRootContent = new ContentBuilder();
1426 result.add(textCleanup(text.substring(3), isLastNode));
1427 } else {
1428 if (!docRootContent.isEmpty()) {
1429 docRootContent = copyDocRootContent(docRootContent);
1430 } else {
1431 text = redirectRelativeLinks(element, (TextTree) dt);
1432 }
1433 result.add(textCleanup(text, isLastNode));
1434 }
1435 } else {
1436 docRootContent = copyDocRootContent(docRootContent);
1437 dt.accept(this, docRootContent);
1438 }
1439 }
1440 copyDocRootContent(docRootContent);
1441 result.add(quote);
1442 return false;
1443 }
1444
|
136 public final DocPath pathToRoot;
137
138 /**
139 * Platform-independent path from the current or the
140 * destination directory to the file getting generated.
141 * Used when creating the file.
142 */
143 public final DocPath path;
144
145 /**
146 * Name of the file getting generated. If the file getting generated is
147 * "java/lang/Object.html", then the filename is "Object.html".
148 */
149 public final DocPath filename;
150
151 /**
152 * The global configuration information for this run.
153 */
154 public final HtmlConfiguration configuration;
155
156 protected final HtmlOptions options;
157
158 protected final Utils utils;
159
160 protected final Contents contents;
161
162 protected final Messages messages;
163
164 protected final Resources resources;
165
166 protected final Links links;
167
168 protected final DocPaths docPaths;
169
170 /**
171 * To check whether annotation heading is printed or not.
172 */
173 protected boolean printedAnnotationHeading = false;
174
175 /**
176 * To check whether annotation field heading is printed or not.
177 */
193 protected String winTitle;
194
195 protected Script mainBodyScript;
196
197 /**
198 * A table of the anchors used for at-index and related tags,
199 * so that they can be made unique by appending a suitable suffix.
200 * (Ideally, javadoc should be tracking all id's generated in a file
201 * to avoid generating duplicates.)
202 */
203 Map<String, Integer> indexAnchorTable = new HashMap<>();
204
205 /**
206 * Constructor to construct the HtmlStandardWriter object.
207 *
208 * @param configuration the configuration for this doclet
209 * @param path the file to be generated.
210 */
211 public HtmlDocletWriter(HtmlConfiguration configuration, DocPath path) {
212 this.configuration = configuration;
213 this.options = configuration.getOptions();
214 this.contents = configuration.contents;
215 this.messages = configuration.messages;
216 this.resources = configuration.resources;
217 this.links = new Links(path);
218 this.utils = configuration.utils;
219 this.path = path;
220 this.pathToRoot = path.parent().invert();
221 this.filename = path.basename();
222 this.docPaths = configuration.docPaths;
223 this.mainBodyScript = new Script();
224
225 messages.notice("doclet.Generating_0",
226 DocFile.createFileForOutput(configuration, path).getPath());
227 }
228
229 /**
230 * Replace {@docRoot} tag used in options that accept HTML text, such
231 * as -header, -footer, -top and -bottom, and when converting a relative
232 * HREF where commentTagsToString inserts a {@docRoot} where one was
233 * missing. (Also see DocRootTaglet for {@docRoot} tags in doc
245 * Note: This doc comment was written with '&#064;' representing '@'
246 * to prevent the inline tag from being interpreted.
247 */
248 public String replaceDocRootDir(String htmlstr) {
249 // Return if no inline tags exist
250 int index = htmlstr.indexOf("{@");
251 if (index < 0) {
252 return htmlstr;
253 }
254 Matcher docrootMatcher = docrootPattern.matcher(htmlstr);
255 if (!docrootMatcher.find()) {
256 return htmlstr;
257 }
258 StringBuilder buf = new StringBuilder();
259 int prevEnd = 0;
260 do {
261 int match = docrootMatcher.start();
262 // append htmlstr up to start of next {@docroot}
263 buf.append(htmlstr.substring(prevEnd, match));
264 prevEnd = docrootMatcher.end();
265 if (options.docrootParent.length() > 0 && htmlstr.startsWith("/..", prevEnd)) {
266 // Insert the absolute link if {@docRoot} is followed by "/..".
267 buf.append(options.docrootParent);
268 prevEnd += 3;
269 } else {
270 // Insert relative path where {@docRoot} was located
271 buf.append(pathToRoot.isEmpty() ? "." : pathToRoot.getPath());
272 }
273 // Append slash if next character is not a slash
274 if (prevEnd < htmlstr.length() && htmlstr.charAt(prevEnd) != '/') {
275 buf.append('/');
276 }
277 } while (docrootMatcher.find());
278 buf.append(htmlstr.substring(prevEnd));
279 return buf.toString();
280 }
281 //where:
282 // Note: {@docRoot} is not case sensitive when passed in with a command-line option:
283 private static final Pattern docrootPattern =
284 Pattern.compile(Pattern.quote("{@docroot}"), Pattern.CASE_INSENSITIVE);
285
286 /**
287 * Get the script to show or hide the All classes link.
288 *
289 * @param id id of the element to show or hide
290 * @return a content tree for the script
291 */
292 public Content getAllClassesLinkScript(String id) {
293 Script script = new Script("<!--\n" +
294 " allClassesLink = document.getElementById(")
295 .appendStringLiteral(id)
296 .append(");\n" +
297 " if(window==top) {\n" +
298 " allClassesLink.style.display = \"block\";\n" +
299 " }\n" +
300 " else {\n" +
301 " allClassesLink.style.display = \"none\";\n" +
302 " }\n" +
325 if ((!intfacs.isEmpty()
326 && vmt.getImplementedMethods(method).isEmpty() == false)
327 || overriddenMethod != null) {
328 MethodWriterImpl.addImplementsInfo(this, method, dl);
329 if (overriddenMethod != null) {
330 MethodWriterImpl.addOverridden(this,
331 utils.overriddenType(method),
332 overriddenMethod,
333 dl);
334 }
335 }
336 }
337
338 /**
339 * Adds the tags information.
340 *
341 * @param e the Element for which the tags will be generated
342 * @param htmltree the documentation tree to which the tags will be added
343 */
344 protected void addTagsInfo(Element e, Content htmltree) {
345 if (options.noComment) {
346 return;
347 }
348 Content dl = new HtmlTree(HtmlTag.DL);
349 if (utils.isExecutableElement(e) && !utils.isConstructor(e)) {
350 addMethodInfo((ExecutableElement)e, dl);
351 }
352 Content output = new ContentBuilder();
353 TagletWriter.genTagOutput(configuration.tagletManager, e,
354 configuration.tagletManager.getBlockTaglets(e),
355 getTagletWriterInstance(false), output);
356 dl.add(output);
357 htmltree.add(dl);
358 }
359
360 /**
361 * Check whether there are any tags for Serialization Overview
362 * section to be printed.
363 *
364 * @param field the VariableElement object to check for tags.
365 * @return true if there are tags to be printed else return false.
434 *
435 * @param metakeywords Array of String keywords for META tag. Each element
436 * of the array is assigned to a separate META tag.
437 * Pass in null for no array
438 * @param description the content for the description META tag.
439 * @param extraHeadContent any additional content to be included in the HEAD element
440 * @param localStylesheets local stylesheets to be included in the HEAD element
441 * @param body the body htmltree to be included in the document
442 * @throws DocFileIOException if there is a problem writing the file
443 */
444 public void printHtmlDocument(List<String> metakeywords,
445 String description,
446 Content extraHeadContent,
447 List<DocPath> localStylesheets,
448 Content body)
449 throws DocFileIOException {
450 Content htmlComment = contents.newPage;
451 List<DocPath> additionalStylesheets = configuration.getAdditionalStylesheets();
452 additionalStylesheets.addAll(localStylesheets);
453 Head head = new Head(path, configuration.docletVersion, configuration.startTime)
454 .setTimestamp(!options.noTimestamp)
455 .setDescription(description)
456 .setGenerator(getGenerator(getClass()))
457 .setTitle(winTitle)
458 .setCharset(options.charset)
459 .addKeywords(metakeywords)
460 .setStylesheets(configuration.getMainStylesheet(), additionalStylesheets)
461 .setIndex(options.createIndex, mainBodyScript)
462 .addContent(extraHeadContent);
463
464 Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body);
465 HtmlDocument htmlDocument = new HtmlDocument(htmlComment, htmlTree);
466 htmlDocument.write(DocFile.createFileForOutput(configuration, path));
467 }
468
469 /**
470 * Get the window title.
471 *
472 * @param title the title string to construct the complete window title
473 * @return the window title string
474 */
475 public String getWindowTitle(String title) {
476 if (options.windowTitle.length() > 0) {
477 title += " (" + options.windowTitle + ")";
478 }
479 return title;
480 }
481
482 /**
483 * Get user specified header and the footer.
484 *
485 * @param header if true print the user provided header else print the
486 * user provided footer.
487 */
488 public Content getUserHeaderFooter(boolean header) {
489 String content;
490 if (header) {
491 content = replaceDocRootDir(options.header);
492 } else {
493 if (options.footer.length() != 0) {
494 content = replaceDocRootDir(options.footer);
495 } else {
496 content = replaceDocRootDir(options.header);
497 }
498 }
499 Content rawContent = new RawHtml(content);
500 return rawContent;
501 }
502
503 /**
504 * Adds the user specified top.
505 *
506 * @param htmlTree the content tree to which user specified top will be added
507 */
508 public void addTop(Content htmlTree) {
509 Content top = new RawHtml(replaceDocRootDir(options.top));
510 htmlTree.add(top);
511 }
512
513 /**
514 * Adds the user specified bottom.
515 *
516 * @param htmlTree the content tree to which user specified bottom will be added
517 */
518 public void addBottom(Content htmlTree) {
519 Content bottom = new RawHtml(replaceDocRootDir(options.bottom));
520 Content small = HtmlTree.SMALL(bottom);
521 Content p = HtmlTree.P(HtmlStyle.legalCopy, small);
522 htmlTree.add(p);
523 }
524
525 /**
526 * Get the overview tree link for the main tree.
527 *
528 * @param label the label for the link
529 * @return a content tree for the link
530 */
531 protected Content getNavLinkMainTree(String label) {
532 Content mainTreeContent = links.createLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE),
533 new StringContent(label));
534 Content li = HtmlTree.LI(mainTreeContent);
535 return li;
536 }
537
538 /**
539 * Get table caption.
1245 * @param htmltree the documentation tree to which the comment tags will be added
1246 */
1247 private void addCommentTags(Element element, List<? extends DocTree> tags, boolean depr,
1248 boolean first, boolean inSummary, Content htmltree) {
1249 addCommentTags(element, null, tags, depr, first, inSummary, htmltree);
1250 }
1251
1252 /**
1253 * Adds the comment tags.
1254 *
1255 * @param element for which the comment tags will be generated
1256 * @param holderTag the block tag context for the inline tags
1257 * @param tags the first sentence tags for the doc
1258 * @param depr true if it is deprecated
1259 * @param first true if the first sentence tags should be added
1260 * @param inSummary true if the comment tags are added into the summary section
1261 * @param htmltree the documentation tree to which the comment tags will be added
1262 */
1263 private void addCommentTags(Element element, DocTree holderTag, List<? extends DocTree> tags, boolean depr,
1264 boolean first, boolean inSummary, Content htmltree) {
1265 if (options.noComment){
1266 return;
1267 }
1268 Content div;
1269 Content result = commentTagsToContent(null, element, tags, first, inSummary);
1270 if (depr) {
1271 div = HtmlTree.DIV(HtmlStyle.deprecationComment, result);
1272 htmltree.add(div);
1273 }
1274 else {
1275 div = HtmlTree.DIV(HtmlStyle.block, result);
1276 htmltree.add(div);
1277 }
1278 if (tags.isEmpty()) {
1279 htmltree.add(Entity.NO_BREAK_SPACE);
1280 }
1281 }
1282
1283 boolean ignoreNonInlineTag(DocTree dtree) {
1284 Name name = null;
1285 if (dtree.getKind() == Kind.START_ELEMENT) {
1406 String quote;
1407 switch (node.getValueKind()) {
1408 case DOUBLE:
1409 quote = "\"";
1410 break;
1411 case SINGLE:
1412 quote = "\'";
1413 break;
1414 default:
1415 quote = "";
1416 break;
1417 }
1418 sb.append(quote);
1419 result.add(sb);
1420 Content docRootContent = new ContentBuilder();
1421
1422 boolean isHRef = inAnAtag() && node.getName().toString().equalsIgnoreCase("href");
1423 for (DocTree dt : node.getValue()) {
1424 if (utils.isText(dt) && isHRef) {
1425 String text = ((TextTree) dt).getBody();
1426 if (text.startsWith("/..") && !options.docrootParent.isEmpty()) {
1427 result.add(options.docrootParent);
1428 docRootContent = new ContentBuilder();
1429 result.add(textCleanup(text.substring(3), isLastNode));
1430 } else {
1431 if (!docRootContent.isEmpty()) {
1432 docRootContent = copyDocRootContent(docRootContent);
1433 } else {
1434 text = redirectRelativeLinks(element, (TextTree) dt);
1435 }
1436 result.add(textCleanup(text, isLastNode));
1437 }
1438 } else {
1439 docRootContent = copyDocRootContent(docRootContent);
1440 dt.accept(this, docRootContent);
1441 }
1442 }
1443 copyDocRootContent(docRootContent);
1444 result.add(quote);
1445 return false;
1446 }
1447
|