44import java .util .Date ;
55import java .util .List ;
66
7+ import org .fugerit .java .core .lang .helpers .StringUtils ;
78import org .fugerit .java .doc .base .config .DocException ;
89import org .fugerit .java .doc .base .helper .DocTypeFacadeDefault ;
910import org .fugerit .java .doc .base .helper .DocTypeFacadeHelper ;
@@ -110,6 +111,9 @@ public void handlePara(DocPara docPara, DocContainer parent, DocTypeFacadeHelper
110111 }
111112 // test
112113 this .handleText (docPara .getText (), docPara .getStyle () );
114+ for ( DocElement element : docPara .getElementList () ) {
115+ handleElement ( element , docPara , helper );
116+ }
113117 if ( body ) {
114118 this .writer .println ( " \n " ); // endline with two white spaces
115119 } else {
@@ -119,7 +123,15 @@ public void handlePara(DocPara docPara, DocContainer parent, DocTypeFacadeHelper
119123
120124 @ Override
121125 public void handlePhrase (DocPhrase docPhrase , DocContainer parent , DocTypeFacadeHelper helper ) throws DocException {
122- this .handleText (docPhrase .getText (), docPhrase .getStyle () );
126+ if (StringUtils .isNotEmpty ( docPhrase .getLink () ) ) {
127+ if ( docPhrase .getLink ().equals ( docPhrase .getText () ) ) {
128+ this .handleText ( String .format ( "<%s>" , docPhrase .getText () ), docPhrase .getStyle () );
129+ } else {
130+ this .handleText ( String .format ( "[%s](%s)" , docPhrase .getText (), docPhrase .getLink () ), docPhrase .getStyle () );
131+ }
132+ } else {
133+ this .handleText (docPhrase .getText (), docPhrase .getStyle () );
134+ }
123135 this .writer .print ( " " );
124136 }
125137
0 commit comments