2 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali-toolkit/internal/text/markup-processor.h>
22 #include <dali/integration-api/debug.h>
23 #include <climits> // for ULONG_MAX
27 #include <dali-toolkit/internal/text/character-set-conversion.h>
28 #include <dali-toolkit/internal/text/markup-processor-anchor.h>
29 #include <dali-toolkit/internal/text/markup-processor-color.h>
30 #include <dali-toolkit/internal/text/markup-processor-embedded-item.h>
31 #include <dali-toolkit/internal/text/markup-processor-font.h>
32 #include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
33 #include <dali-toolkit/internal/text/xhtml-entities.h>
43 // HTML-ISH tag and attribute constants.
44 // Note they must be lower case in order to make the comparison to work
45 // as the parser converts all the read tags to lower case.
46 const std::string XHTML_COLOR_TAG("color");
47 const std::string XHTML_FONT_TAG("font");
48 const std::string XHTML_B_TAG("b");
49 const std::string XHTML_I_TAG("i");
50 const std::string XHTML_U_TAG("u");
51 const std::string XHTML_SHADOW_TAG("shadow");
52 const std::string XHTML_GLOW_TAG("glow");
53 const std::string XHTML_OUTLINE_TAG("outline");
54 const std::string XHTML_ITEM_TAG("item");
55 const std::string XHTML_ANCHOR_TAG("a");
57 const char LESS_THAN = '<';
58 const char GREATER_THAN = '>';
59 const char EQUAL = '=';
60 const char QUOTATION_MARK = '\'';
61 const char SLASH = '/';
62 const char BACK_SLASH = '\\';
63 const char AMPERSAND = '&';
64 const char HASH = '#';
65 const char SEMI_COLON = ';';
66 const char CHAR_ARRAY_END = '\0';
67 const char HEX_CODE = 'x';
69 const char WHITE_SPACE = 0x20; // ASCII value of the white space.
71 // Range 1 0x0u < XHTML_DECIMAL_ENTITY_RANGE <= 0xD7FFu
72 // Range 2 0xE000u < XHTML_DECIMAL_ENTITY_RANGE <= 0xFFFDu
73 // Range 3 0x10000u < XHTML_DECIMAL_ENTITY_RANGE <= 0x10FFFFu
74 const unsigned long XHTML_DECIMAL_ENTITY_RANGE[] = {0x0u, 0xD7FFu, 0xE000u, 0xFFFDu, 0x10000u, 0x10FFFFu};
76 const unsigned int MAX_NUM_OF_ATTRIBUTES = 5u; ///< The font tag has the 'family', 'size' 'weight', 'width' and 'slant' attrubutes.
77 const unsigned int DEFAULT_VECTOR_SIZE = 16u; ///< Default size of run vectors.
79 #if defined(DEBUG_ENABLED)
80 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_MARKUP_PROCESSOR");
84 * @brief Struct used to retrieve the style runs from the mark-up string.
88 typedef VectorBase::SizeType RunIndex;
90 Vector<RunIndex> stack; ///< Use a vector as a style stack. Stores the indices pointing where the run is stored inside the logical model.
91 unsigned int topIndex; ///< Points the top of the stack.
97 stack.Resize(DEFAULT_VECTOR_SIZE);
100 void Push(RunIndex index)
102 // Check if there is space inside the style stack.
103 const VectorBase::SizeType size = stack.Count();
106 // Resize the style stack.
107 stack.Resize(2u * size);
110 // Set the run index in the top of the stack.
111 *(stack.Begin() + topIndex) = index;
113 // Reposition the pointer to the top of the stack.
119 // Pop the top of the stack.
121 return *(stack.Begin() + topIndex);
126 * @brief Initializes a font run description to its defaults.
128 * @param[in,out] fontRun The font description run to initialize.
130 void Initialize(FontDescriptionRun& fontRun)
132 fontRun.characterRun.characterIndex = 0u;
133 fontRun.characterRun.numberOfCharacters = 0u;
134 fontRun.familyName = NULL;
135 fontRun.familyLength = 0u;
136 fontRun.weight = TextAbstraction::FontWeight::NORMAL;
137 fontRun.width = TextAbstraction::FontWidth::NORMAL;
138 fontRun.slant = TextAbstraction::FontSlant::NORMAL;
140 fontRun.familyDefined = false;
141 fontRun.weightDefined = false;
142 fontRun.widthDefined = false;
143 fontRun.slantDefined = false;
144 fontRun.sizeDefined = false;
148 * @brief Initializes a color run description to its defaults.
150 * @param[in,out] colorRun The font description run to initialize.
152 void Initialize(ColorRun& colorRun)
154 colorRun.characterRun.characterIndex = 0u;
155 colorRun.characterRun.numberOfCharacters = 0u;
159 * @brief Initializes a underlined character run to its defaults.
161 * @param[in,out] underlinedCharacterRun The underelined character run to initialize.
163 void Initialize(UnderlinedCharacterRun& underlinedCharacterRun)
165 underlinedCharacterRun.characterRun.characterIndex = 0u;
166 underlinedCharacterRun.characterRun.numberOfCharacters = 0u;
170 * @brief Splits the tag string into the tag name and its attributes.
172 * The attributes are stored in a vector in the tag.
174 * @param[in,out] tag The tag.
176 void ParseAttributes(Tag& tag)
178 if(tag.buffer == NULL)
183 tag.attributes.Resize(MAX_NUM_OF_ATTRIBUTES);
185 // Find first the tag name.
186 bool isQuotationOpen = false;
188 const char* tagBuffer = tag.buffer;
189 const char* const tagEndBuffer = tagBuffer + tag.length;
191 for(; tagBuffer < tagEndBuffer; ++tagBuffer)
193 const char character = *tagBuffer;
194 if(WHITE_SPACE < character)
200 // Stops counting the length of the tag when a white space is found.
201 // @note a white space is the WHITE_SPACE character and anything below as 'tab', 'return' or 'control characters'.
205 SkipWhiteSpace(tagBuffer, tagEndBuffer);
207 // Find the attributes.
208 unsigned int attributeIndex = 0u;
209 const char* nameBuffer = NULL;
210 const char* valueBuffer = NULL;
211 Length nameLength = 0u;
212 Length valueLength = 0u;
214 bool addToNameValue = true;
215 Length numberOfWhiteSpace = 0u;
216 for(; tagBuffer < tagEndBuffer; ++tagBuffer)
218 const char character = *tagBuffer;
219 if((WHITE_SPACE >= character) && !isQuotationOpen)
221 if(NULL != valueBuffer)
223 // Remove white spaces at the end of the value.
224 valueLength -= numberOfWhiteSpace;
227 if((NULL != nameBuffer) && (NULL != valueBuffer))
229 // Every time a white space is found, a new attribute is created and stored in the attributes vector.
230 Attribute& attribute = *(tag.attributes.Begin() + attributeIndex);
233 attribute.nameBuffer = nameBuffer;
234 attribute.valueBuffer = valueBuffer;
235 attribute.nameLength = nameLength;
236 attribute.valueLength = valueLength;
243 addToNameValue = true; // next read characters will be added to the name.
246 else if(EQUAL == character) // '='
248 addToNameValue = false; // next read characters will be added to the value.
249 SkipWhiteSpace(tagBuffer, tagEndBuffer);
251 else if(QUOTATION_MARK == character) // '\''
253 // Do not add quotation marks to neither name nor value.
254 isQuotationOpen = !isQuotationOpen;
259 SkipWhiteSpace(tagBuffer, tagEndBuffer);
265 // Adds characters to the name or the value.
268 if(NULL == nameBuffer)
270 nameBuffer = tagBuffer;
278 if(WHITE_SPACE >= character)
280 ++numberOfWhiteSpace;
284 numberOfWhiteSpace = 0u;
287 if(NULL == valueBuffer)
289 valueBuffer = tagBuffer;
296 if(NULL != valueBuffer)
298 // Remove white spaces at the end of the value.
299 valueLength -= numberOfWhiteSpace;
302 if((NULL != nameBuffer) && (NULL != valueBuffer))
304 // Checks if the last attribute needs to be added.
305 Attribute& attribute = *(tag.attributes.Begin() + attributeIndex);
308 attribute.nameBuffer = nameBuffer;
309 attribute.valueBuffer = valueBuffer;
310 attribute.nameLength = nameLength;
311 attribute.valueLength = valueLength;
314 // Resize the vector of attributes.
315 tag.attributes.Resize(attributeIndex);
319 * @brief It parses a tag and its attributes if the given iterator @e it is pointing at a tag beginning.
321 * @param[in,out] markupStringBuffer The mark-up string buffer. It's a const iterator pointing the current character.
322 * @param[in] markupStringEndBuffer Pointer to one character after the end of the mark-up string buffer.
323 * @param[out] tag The tag with its attributes.
325 * @return @e true if the iterator @e it is pointing a mark-up tag. Otherwise @e false.
327 bool IsTag(const char*& markupStringBuffer,
328 const char* const markupStringEndBuffer,
332 bool isQuotationOpen = false;
333 bool attributesFound = false;
334 tag.isEndTag = false;
335 bool isPreviousLessThan = false;
336 bool isPreviousSlash = false;
338 const char character = *markupStringBuffer;
339 if(LESS_THAN == character) // '<'
343 isPreviousLessThan = true;
345 // if the iterator is pointing to a '<' character, then check if it's a mark-up tag is needed.
346 ++markupStringBuffer;
347 if(markupStringBuffer < markupStringEndBuffer)
349 SkipWhiteSpace(markupStringBuffer, markupStringEndBuffer);
351 for(; (!isTag) && (markupStringBuffer < markupStringEndBuffer); ++markupStringBuffer)
353 const char character = *markupStringBuffer;
355 if(!isQuotationOpen && (SLASH == character)) // '/'
357 if(isPreviousLessThan)
363 // if the tag has a '/' it may be an end tag.
364 isPreviousSlash = true;
367 isPreviousLessThan = false;
368 if((markupStringBuffer + 1u < markupStringEndBuffer) && (WHITE_SPACE >= *(markupStringBuffer + 1u)))
370 ++markupStringBuffer;
371 SkipWhiteSpace(markupStringBuffer, markupStringEndBuffer);
372 --markupStringBuffer;
375 else if(GREATER_THAN == character) // '>'
383 isPreviousSlash = false;
384 isPreviousLessThan = false;
386 else if(QUOTATION_MARK == character)
388 isQuotationOpen = !isQuotationOpen;
391 isPreviousSlash = false;
392 isPreviousLessThan = false;
394 else if(WHITE_SPACE >= character) // ' '
396 // If the tag contains white spaces then it may have attributes.
399 attributesFound = true;
405 if(NULL == tag.buffer)
407 tag.buffer = markupStringBuffer;
410 // If it's not any of the 'special' characters then just add it to the tag string.
413 isPreviousSlash = false;
414 isPreviousLessThan = false;
419 // If the tag string has white spaces, then parse the attributes is needed.
422 ParseAttributes(tag);
430 * @brief Returns length of XHTML entity by parsing the text. It also determines if it is XHTML entity or not.
432 * @param[in] markupStringBuffer The mark-up string buffer. It's a const iterator pointing the current character.
433 * @param[in] markupStringEndBuffer Pointing to end of mark-up string buffer.
435 * @return Length of markupText in case of XHTML entity otherwise return 0.
437 unsigned int GetXHTMLEntityLength(const char*& markupStringBuffer,
438 const char* const markupStringEndBuffer)
440 char character = *markupStringBuffer;
441 if(AMPERSAND == character) // '&'
443 // if the iterator is pointing to a '&' character, then check for ';' to find end to XHTML entity.
444 ++markupStringBuffer;
445 if(markupStringBuffer < markupStringEndBuffer)
447 unsigned int len = 1u;
448 for(; markupStringBuffer < markupStringEndBuffer; ++markupStringBuffer)
450 character = *markupStringBuffer;
452 if(SEMI_COLON == character) // ';'
454 // found end of XHTML entity
455 ++markupStringBuffer;
458 else if((AMPERSAND == character) || (BACK_SLASH == character) || (LESS_THAN == character))
469 * @brief It parses a XHTML string which has hex/decimal entity and fill its corresponging utf-8 string.
471 * @param[in] markupText The mark-up text buffer.
472 * @param[out] utf-8 text Corresponding to markup Text
474 * @return true if string is successfully parsed otherwise false
476 bool XHTMLNumericEntityToUtf8(const char* markupText, char* utf8)
480 if(NULL != markupText)
484 // check if hex or decimal entity
485 if((CHAR_ARRAY_END != *markupText) && (HEX_CODE == *markupText))
492 unsigned long l = strtoul(markupText, &end, (isHex ? 16 : 10)); // l contains UTF-32 code in case of correct XHTML entity
494 // check for valid XHTML numeric entities (between '#' or "#x" and ';')
495 if((l > 0) && (l < ULONG_MAX) && (*end == SEMI_COLON)) // in case wrong XHTML entity is set eg. "abcdefs;" in that case *end will be 'a'
497 /* characters XML 1.1 permits */
498 if(((XHTML_DECIMAL_ENTITY_RANGE[0] < l) && (l <= XHTML_DECIMAL_ENTITY_RANGE[1])) ||
499 ((XHTML_DECIMAL_ENTITY_RANGE[2] <= l) && (l <= XHTML_DECIMAL_ENTITY_RANGE[3])) ||
500 ((XHTML_DECIMAL_ENTITY_RANGE[4] <= l) && (l <= XHTML_DECIMAL_ENTITY_RANGE[5])))
502 // Convert UTF32 code to UTF8
503 Utf32ToUtf8(reinterpret_cast<const uint32_t* const>(&l), 1, reinterpret_cast<uint8_t*>(utf8));
512 * @brief Processes a particular tag for the required run (color-run, font-run or underlined-character-run).
514 * @tparam RunType Whether ColorRun , FontDescriptionRun or UnderlinedCharacterRun
516 * @param[in/out] runsContainer The container containing all the runs
517 * @param[in/out] styleStack The style stack
518 * @param[in] tag The tag we are currently processing
519 * @param[in] characterIndex The current character index
520 * @param[in/out] runIndex The run index
521 * @param[in/out] tagReference The tagReference we should increment/decrement
522 * @param[in] parameterSettingFunction This function will be called to set run specific parameters
524 template<typename RunType>
525 void ProcessTagForRun(
526 Vector<RunType>& runsContainer,
527 StyleStack& styleStack,
529 const CharacterIndex characterIndex,
530 StyleStack::RunIndex& runIndex,
532 std::function<void(const Tag&, RunType&)> parameterSettingFunction)
540 // Fill the run with the parameters.
541 run.characterRun.characterIndex = characterIndex;
542 parameterSettingFunction(tag, run);
544 // Push the run in the logical model.
545 runsContainer.PushBack(run);
547 // Push the index of the run into the stack.
548 styleStack.Push(runIndex);
550 // Point the next free run.
553 // Increase reference
560 // Pop the top of the stack and set the number of characters of the run.
561 RunType& run = *(runsContainer.Begin() + styleStack.Pop());
562 run.characterRun.numberOfCharacters = characterIndex - run.characterRun.characterIndex;
569 * @brief Processes the item tag
571 * @param[in/out] markupProcessData The markup process data
572 * @param[in] tag The current tag
573 * @param[in/out] characterIndex The current character index
576 MarkupProcessData& markupProcessData,
578 CharacterIndex& characterIndex)
582 // Create an embedded item instance.
584 item.characterIndex = characterIndex;
585 ProcessEmbeddedItem(tag, item);
587 markupProcessData.items.PushBack(item);
589 // Insert white space character that will be replaced by the item.
590 markupProcessData.markupProcessedText.append(1u, WHITE_SPACE);
596 * @brief Processes the anchor tag
598 * @param[in/out] markupProcessData The markup process data
599 * @param[in] tag The current tag
600 * @param[in/out] characterIndex The current character index
602 void ProcessAnchorTag(
603 MarkupProcessData& markupProcessData,
605 CharacterIndex& characterIndex)
609 // Create an anchor instance.
611 anchor.startIndex = characterIndex;
612 anchor.endIndex = 0u;
613 ProcessAnchor(tag, anchor);
614 markupProcessData.anchors.PushBack(anchor);
619 unsigned int count = markupProcessData.anchors.Count();
622 markupProcessData.anchors[count - 1].endIndex = characterIndex;
628 * @brief Resizes the model's vectors
630 * @param[in/out] markupProcessData The markup process data
631 * @param[in] fontRunIndex The font run index
632 * @param[in] colorRunIndex The color run index
633 * @param[in] underlinedCharacterRunIndex The underlined character run index
635 void ResizeModelVectors(MarkupProcessData& markupProcessData, const StyleStack::RunIndex fontRunIndex, const StyleStack::RunIndex colorRunIndex, const StyleStack::RunIndex underlinedCharacterRunIndex)
637 markupProcessData.fontRuns.Resize(fontRunIndex);
638 markupProcessData.colorRuns.Resize(colorRunIndex);
639 markupProcessData.underlinedCharacterRuns.Resize(underlinedCharacterRunIndex);
642 for(unsigned int i = 0; i < colorRunIndex; ++i)
644 ColorRun& run = markupProcessData.colorRuns[i];
645 DALI_LOG_INFO(gLogFilter, Debug::Verbose, "run[%d] index: %d, length: %d, color %f,%f,%f,%f\n", i, run.characterRun.characterIndex, run.characterRun.numberOfCharacters, run.color.r, run.color.g, run.color.b, run.color.a);
651 * @brief Processes the markup string buffer
653 * @param[in/out] markupProcessData The markup process data
654 * @param[in/out] markupStringBuffer The markup string buffer pointer
655 * @param[in] markupStringEndBuffer The markup string end buffer pointer
656 * @param[in/out] characterIndex The current character index
658 void ProcessMarkupStringBuffer(
659 MarkupProcessData& markupProcessData,
660 const char*& markupStringBuffer,
661 const char* const markupStringEndBuffer,
662 CharacterIndex& characterIndex)
664 unsigned char character = *markupStringBuffer;
665 const char* markupBuffer = markupStringBuffer;
666 unsigned char count = GetUtf8Length(character);
669 if((BACK_SLASH == character) && (markupStringBuffer + 1u < markupStringEndBuffer))
671 // Adding < , > or & special character.
672 const unsigned char nextCharacter = *(markupStringBuffer + 1u);
673 if((LESS_THAN == nextCharacter) || (GREATER_THAN == nextCharacter) || (AMPERSAND == nextCharacter))
675 character = nextCharacter;
676 ++markupStringBuffer;
678 count = GetUtf8Length(character);
679 markupBuffer = markupStringBuffer;
682 else // checking if contains XHTML entity or not
684 const unsigned int len = GetXHTMLEntityLength(markupStringBuffer, markupStringEndBuffer);
686 // Parse markupStringTxt if it contains XHTML Entity between '&' and ';'
689 char* entityCode = NULL;
693 // Checking if XHTML Numeric Entity
694 if(HASH == *(markupBuffer + 1u))
696 entityCode = &utf8[0];
697 // markupBuffer is currently pointing to '&'. By adding 2u to markupBuffer it will point to numeric string by skipping "&#'
698 result = XHTMLNumericEntityToUtf8((markupBuffer + 2u), entityCode);
700 else // Checking if XHTML Named Entity
702 entityCode = const_cast<char*>(NamedEntityToUtf8(markupBuffer, len));
703 result = (entityCode != NULL);
707 markupBuffer = entityCode; //utf8 text assigned to markupBuffer
708 character = markupBuffer[0];
712 DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Not valid XHTML entity : (%.*s) \n", len, markupBuffer);
716 else // in case string conatins Start of XHTML Entity('&') but not its end character(';')
718 if(character == AMPERSAND)
721 DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Not Well formed XHTML content \n");
726 if(markupBuffer != NULL)
728 const unsigned char numberOfBytes = GetUtf8Length(character);
729 markupProcessData.markupProcessedText.push_back(character);
731 for(unsigned char i = 1u; i < numberOfBytes; ++i)
734 markupProcessData.markupProcessedText.push_back(*markupBuffer);
738 markupStringBuffer += count;
744 void ProcessMarkupString(const std::string& markupString, MarkupProcessData& markupProcessData)
746 DALI_LOG_INFO(gLogFilter, Debug::Verbose, "markupString: %s\n", markupString.c_str());
748 // Reserve space for the plain text.
749 const Length markupStringSize = markupString.size();
750 markupProcessData.markupProcessedText.reserve(markupStringSize);
752 // Stores a struct with the index to the first character of the run, the type of run and its parameters.
753 StyleStack styleStack;
755 // Points the next free position in the vector of runs.
756 StyleStack::RunIndex colorRunIndex = 0u;
757 StyleStack::RunIndex fontRunIndex = 0u;
758 StyleStack::RunIndex underlinedCharacterRunIndex = 0u;
760 // check tag reference
761 int colorTagReference = 0u;
762 int fontTagReference = 0u;
763 int iTagReference = 0u;
764 int bTagReference = 0u;
765 int uTagReference = 0u;
767 // Give an initial default value to the model's vectors.
768 markupProcessData.colorRuns.Reserve(DEFAULT_VECTOR_SIZE);
769 markupProcessData.fontRuns.Reserve(DEFAULT_VECTOR_SIZE);
770 markupProcessData.underlinedCharacterRuns.Reserve(DEFAULT_VECTOR_SIZE);
772 // Get the mark-up string buffer.
773 const char* markupStringBuffer = markupString.c_str();
774 const char* const markupStringEndBuffer = markupStringBuffer + markupStringSize;
777 CharacterIndex characterIndex = 0u;
778 for(; markupStringBuffer < markupStringEndBuffer;)
780 tag.attributes.Clear();
781 if(IsTag(markupStringBuffer,
782 markupStringEndBuffer,
785 if(TokenComparison(XHTML_COLOR_TAG, tag.buffer, tag.length))
787 ProcessTagForRun<ColorRun>(
788 markupProcessData.colorRuns, styleStack, tag, characterIndex, colorRunIndex, colorTagReference, [](const Tag& tag, ColorRun& run) { ProcessColorTag(tag, run); });
790 else if(TokenComparison(XHTML_I_TAG, tag.buffer, tag.length))
792 ProcessTagForRun<FontDescriptionRun>(
793 markupProcessData.fontRuns, styleStack, tag, characterIndex, fontRunIndex, iTagReference, [](const Tag&, FontDescriptionRun& fontRun) {
794 fontRun.slant = TextAbstraction::FontSlant::ITALIC;
795 fontRun.slantDefined = true;
798 else if(TokenComparison(XHTML_U_TAG, tag.buffer, tag.length))
800 ProcessTagForRun<UnderlinedCharacterRun>(
801 markupProcessData.underlinedCharacterRuns, styleStack, tag, characterIndex, underlinedCharacterRunIndex, uTagReference, [](const Tag& tag, UnderlinedCharacterRun& run) { });
803 else if(TokenComparison(XHTML_B_TAG, tag.buffer, tag.length))
805 ProcessTagForRun<FontDescriptionRun>(
806 markupProcessData.fontRuns, styleStack, tag, characterIndex, fontRunIndex, bTagReference, [](const Tag&, FontDescriptionRun& fontRun) {
807 fontRun.weight = TextAbstraction::FontWeight::BOLD;
808 fontRun.weightDefined = true;
811 else if(TokenComparison(XHTML_FONT_TAG, tag.buffer, tag.length))
813 ProcessTagForRun<FontDescriptionRun>(
814 markupProcessData.fontRuns, styleStack, tag, characterIndex, fontRunIndex, fontTagReference, [](const Tag& tag, FontDescriptionRun& fontRun) { ProcessFontTag(tag, fontRun); });
816 else if(TokenComparison(XHTML_ANCHOR_TAG, tag.buffer, tag.length))
819 ProcessAnchorTag(markupProcessData, tag, characterIndex);
821 ProcessTagForRun<ColorRun>(
822 markupProcessData.colorRuns, styleStack, tag, characterIndex, colorRunIndex, colorTagReference, [](const Tag& tag, ColorRun& run) {
823 run.color = Color::BLUE;
824 ProcessColorTag(tag, run);
826 /* TODO - underline */
827 } // <a href=https://www.tizen.org>tizen</a>
828 else if(TokenComparison(XHTML_SHADOW_TAG, tag.buffer, tag.length))
830 // TODO: If !tag.isEndTag, then create a new shadow run.
831 // else Pop the top of the stack and set the number of characters of the run.
832 } // <shadow></shadow>
833 else if(TokenComparison(XHTML_GLOW_TAG, tag.buffer, tag.length))
835 // TODO: If !tag.isEndTag, then create a new glow run.
836 // else Pop the top of the stack and set the number of characters of the run.
838 else if(TokenComparison(XHTML_OUTLINE_TAG, tag.buffer, tag.length))
840 // TODO: If !tag.isEndTag, then create a new outline run.
841 // else Pop the top of the stack and set the number of characters of the run.
842 } // <outline></outline>
843 else if(TokenComparison(XHTML_ITEM_TAG, tag.buffer, tag.length))
845 ProcessItemTag(markupProcessData, tag, characterIndex);
847 } // end if( IsTag() )
848 else if(markupStringBuffer < markupStringEndBuffer)
850 ProcessMarkupStringBuffer(markupProcessData, markupStringBuffer, markupStringEndBuffer, characterIndex);
854 // Resize the model's vectors.
855 ResizeModelVectors(markupProcessData, fontRunIndex, colorRunIndex, underlinedCharacterRunIndex);
860 } // namespace Toolkit