Add underline to anchor in the markup processor 89/271489/1
authorBowon Ryu <bowon.ryu@samsung.com>
Tue, 22 Feb 2022 05:22:53 +0000 (14:22 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Tue, 22 Feb 2022 05:22:53 +0000 (14:22 +0900)
With a recent change, the underline run provides a color property.
So, now we can support color underline for text anchor style.

Change-Id: I9068a7733c1031b60625cb8fb356ac189aa4ae35
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
dali-toolkit/internal/text/markup-processor.cpp

index 17aae96..6180699 100644 (file)
@@ -966,7 +966,13 @@ void ProcessMarkupString(const std::string& markupString, MarkupProcessData& mar
             run.color = Color::BLUE;
             ProcessColorTag(tag, run);
           });
-        /* TODO - underline */
+        /* Underline */
+        ProcessTagForRun<UnderlinedCharacterRun>(
+          markupProcessData.underlinedCharacterRuns, styleStack, tag, characterIndex, underlinedCharacterRunIndex, uTagReference, [](const Tag& tag, UnderlinedCharacterRun& run) {
+            run.properties.color = Color::BLUE;
+            run.properties.colorDefined = true;
+            ProcessUnderlineTag(tag, run);
+          });
       } // <a href=https://www.tizen.org>tizen</a>
       else if(TokenComparison(XHTML_SHADOW_TAG, tag.buffer, tag.length))
       {