]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/markdown/nodes/LinkNode.java
Fixed diagram copy/paste implementations to re-identify diagram elements
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / markdown / nodes / LinkNode.java
1 package org.simantics.scl.compiler.markdown.nodes;
2
3 import org.simantics.scl.compiler.markdown.internal.HtmlEscape;
4
5 public class LinkNode extends Node {
6     public String label;
7     public String url;
8     public String title;
9     
10     public LinkNode(String label, String url, String title) {
11         this.label = label;
12         this.url = url;
13         this.title = title;
14     }
15     
16     @Override
17     public void toHtml(StringBuilder b) {
18         b.append("<a href=\"").append(HtmlEscape.escapeURL(url));
19         if(title.isEmpty())
20             b.append("\">");
21         else {
22             b.append("\" title=\"");
23             b.append(HtmlEscape.escape(title));
24             b.append("\">");
25         }
26         super.toHtml(b);
27         b.append("</a>");
28     }
29 }