|
26 | 26 |
|
27 | 27 | <#macro handlePhrase current> |
28 | 28 | <#if (current.link)??> |
29 | | - <a <@handleStyleOnly styleValue=current.style/> href="${current.link}">${current.text}</a> |
| 29 | + <a <@handleId element=current/><@handleStyleOnly styleValue=current.style/> href="${current.link}">${current.text}</a> |
30 | 30 | <#elseif (current.anchor)??> |
31 | | - <a <@handleStyleOnly styleValue=current.style/> name="${current.anchor}">${current.text}</a> |
| 31 | + <a <@handleId element=current/><@handleStyleOnly styleValue=current.style/> name="${current.anchor}">${current.text}</a> |
32 | 32 | <#else> |
33 | | - <span <@handleStyleOnly styleValue=current.style/>>${current.text}</span> |
| 33 | + <span <@handleId element=current/><@handleStyleOnly styleValue=current.style/>>${current.text}</span> |
34 | 34 | </#if> |
35 | 35 | </#macro> |
36 | 36 |
|
37 | 37 | <#macro handlePara current> |
38 | 38 | <#if current.headLevel == 0> |
39 | | - <p <@handleStyleComplete element=current styleValue=current.originalStyle alignValue=current.align spaceBefore=current.spaceBefore!0 spaceAfter=current.spaceAfter!0/>>${current.text}<#list current.elementList as currentChild><@handleElement current=currentChild/></#list></p> |
| 39 | + <p <@handleId element=current/><@handleStyleComplete element=current styleValue=current.originalStyle alignValue=current.align spaceBefore=current.spaceBefore!0 spaceAfter=current.spaceAfter!0/>>${current.text}<#list current.elementList as currentChild><@handleElement current=currentChild/></#list></p> |
40 | 40 | <#else> |
41 | | - <h${current.headLevel} <@handleStyleComplete element=current styleValue=current.style alignValue=current.align spaceBefore=current.spaceBefore!0 spaceAfter=current.spaceAfter!0/>>${current.text}<#list current.elementList as currentChild><@handleElement current=currentChild/></#list></h${current.headLevel}> |
| 41 | + <h${current.headLevel} <@handleId element=current/><@handleStyleComplete element=current styleValue=current.style alignValue=current.align spaceBefore=current.spaceBefore!0 spaceAfter=current.spaceAfter!0/>>${current.text}<#list current.elementList as currentChild><@handleElement current=currentChild/></#list></h${current.headLevel}> |
42 | 42 | </#if> |
43 | 43 | </#macro> |
44 | 44 |
|
|
53 | 53 | <#assign imageAlign="style='display: block; margin-left: auto; margin-right: auto;'"/> |
54 | 54 | </#if> |
55 | 55 | </#if> |
56 | | - <img ${imageAlign!''} <#if (docImage.alt)??> alt="${docImage.alt}" </#if> ${imageScaling} src="data:image/png;base64, ${docImage.resolvedBase64}" /> |
| 56 | + <img <@handleId element=current/> ${imageAlign!''} <#if (docImage.alt)??> alt="${docImage.alt}" </#if> ${imageScaling} src="data:image/png;base64, ${docImage.resolvedBase64}" /> |
57 | 57 | </#macro> |
58 | 58 |
|
59 | 59 | <#macro handleList docList> |
60 | 60 | <#if docList.elementList?size gt 0> |
61 | | - <${docList.htmlType}> |
| 61 | + <${docList.htmlType} <@handleId element=current/>> |
62 | 62 | <#list docList.elementList as li> |
63 | 63 | <#if (li?counter > 0)> |
64 | | - <li <#if li.contentList>style="list-style-type: none;"<#elseif docList.listType = 'oll'>style="list-style-type: lower-alpha;"<#elseif docList.listType = 'ulm'>style="list-style-type: square;"<#elseif docList.listType = 'uld'>style="list-style-type: circle;"</#if>> <#list li.elementList as element><@handleElement current=element/></#list></li> |
| 64 | + <li <@handleId element=current/><#if li.contentList>style="list-style-type: none;"<#elseif docList.listType = 'oll'>style="list-style-type: lower-alpha;"<#elseif docList.listType = 'ulm'>style="list-style-type: square;"<#elseif docList.listType = 'uld'>style="list-style-type: circle;"</#if>> <#list li.elementList as element><@handleElement current=element/></#list></li> |
65 | 65 | </#if> |
66 | 66 | <#assign prevLi=li/> |
67 | 67 | </#list> |
|
71 | 71 |
|
72 | 72 | <#macro handleRowList docTable rowList cellType> |
73 | 73 | <#list rowList as row> |
74 | | - <tr> |
75 | | - <#list row.elementList as cell> |
76 | | - <${cellType} id="cell_${row?index}_${cell?index}" style="width: ${docTable.colWithds[cell?index]}%; <@handleAlign alignValue=cell.align/> <@handleBorders docBorders=cell.docBorders/>" <@handleColspan colspanValue=cell.columnSpan/> <@handleRowspan rowspanValue=cell.rowSpan/>> |
| 74 | + <tr <@handleId element=row/>> |
| 75 | + <#list row.elementList as cell><#assign defCellId>cell_${row?index}_${cell?index}</#assign> |
| 76 | + <${cellType} <@handleIdDef element=cell defId=defCellId/> style="width: ${docTable.colWithds[cell?index]}%; <@handleAlign alignValue=cell.align/> <@handleBorders docBorders=cell.docBorders/>" <@handleColspan colspanValue=cell.columnSpan/> <@handleRowspan rowspanValue=cell.rowSpan/>> |
77 | 77 | <#list cell.elementList as cellElement> |
78 | 78 | <@handleElement current=cellElement/> |
79 | 79 | </#list> |
|
130 | 130 | <@handleBorder mode='border-right' size=docBorders.borderWidthRight color=borderColorRight/> |
131 | 131 | </#macro> |
132 | 132 |
|
| 133 | +<#macro handleIdDef element defId><#if element.id??>id="${element.id}" <#else>id="${defId}"</#if></#macro> |
| 134 | + |
| 135 | +<#macro handleId element><#if element.id??>id="${element.id}" </#if></#macro> |
| 136 | + |
133 | 137 | <#macro handleRowspan rowspanValue> rowspan="${rowspanValue}" </#macro> |
134 | 138 |
|
135 | 139 | <#macro handleColspan colspanValue> colspan="${colspanValue}" </#macro> |
|
0 commit comments