Skip to content

Commit 5d66953

Browse files
committed
fix: fj-doc-freemarker, html handler now renders fore color for phrase.
1 parent a54f7d0 commit 5d66953

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- fj-doc-freemarker, html handler now renders fore color for phrase.
13+
1014
## [8.17.7] - 2025-11-20
1115

1216
### Added

fj-doc-base/src/main/java/org/fugerit/java/doc/base/parser/DocParserContext.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,9 @@ private static void valuePhrase( DocPhrase docPhrase, Properties props ) {
472472
// font name
473473
String fontName = props.getProperty( "font-name" );
474474
docPhrase.setFontName( fontName );
475+
// foreground color
476+
String foreColor = props.getProperty( "fore-color" );
477+
docPhrase.setForeColor( foreColor );
475478
//leading
476479
String leading = props.getProperty( "leading" );
477480
if ( leading != null ) {

fj-doc-freemarker/src/main/resources/fj_doc_freemarker_config/template/macro/html_element.ftl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535

3636
<#macro handlePhrase current>
3737
<#if (current.link)??>
38-
<a <@handleId element=current/><@handleStyleOnly styleValue=current.style/> href="${current.link}"><@escape.printText e=current/></a>
38+
<a <@handleId element=current/><@handleStyleOnly element=current/> href="${current.link}"><@escape.printText e=current/></a>
3939
<#elseif (current.anchor)??>
40-
<span <@handleId element=current/><@handleStyleOnly styleValue=current.style/>><@escape.printText e=current/></span>
40+
<span <@handleId element=current/><@handleStyleOnly element=current/>><@escape.printText e=current/></span>
4141
<#else>
42-
<span <@handleId element=current/><@handleStyleOnly styleValue=current.style/>><@escape.printText e=current/></span>
42+
<span <@handleId element=current/><@handleStyleOnly element=current/>><@escape.printText e=current/></span>
4343
</#if>
4444
</#macro>
4545

@@ -168,7 +168,7 @@ white-space-collapse -> false : white-space-collapse: preserve; white-space: pre
168168

169169
<#macro handleStyle styleValue><#if styleValue = 2> font-weight: bold;<#elseif styleValue = 3> text-decoration: underline;<#elseif styleValue = 4> font-style: italic;<#elseif styleValue = 5> font-weight: bold; font-style: italic;</#if></#macro>
170170

171-
<#macro handleStyleOnly styleValue><#assign cStyle><@handleStyle styleValue=styleValue/></#assign><@handleStylePrint cStyle=cStyle/></#macro>
171+
<#macro handleStyleOnly element><#assign cStyle><@handleStyle styleValue=element.style/> <@handleFont element=element/></#assign><@handleStylePrint cStyle=cStyle/></#macro>
172172

173173
<#macro handleStyleComplete element styleValue alignValue dc><#assign cStyle><@handleFont element=element/> <@handleStyle styleValue=styleValue/></#assign><#assign cStyle>${cStyle} <@handleAlign alignValue=alignValue/></#assign><#assign cStyle>${cStyle} <@handleSpacing dc=dc/></#assign><@handleStylePrint cStyle=cStyle/></#macro>
174174

0 commit comments

Comments
 (0)