private static void constructBlockGroupText(BlockGroupMatch groupOpen, ref string newOpenText, ref string newCloseText)
        {
            newCloseText = "</" + KARAS.ReservedBlockGroupTypes[groupOpen.type] + ">";
            string optionText = "";

            if (groupOpen.option.Length != 0)
            {
                optionText = " class=\"" + groupOpen.option + "\"";
            }

            newOpenText = "<" + KARAS.ReservedBlockGroupTypes[groupOpen.type] + optionText + ">";

            if (groupOpen.type >= KARAS.BlockGroupTypePre)
            {
                if (groupOpen.type >= KARAS.BlockGroupTypeCode)
                {
                    newOpenText = "<pre" + optionText + ">" + newOpenText;
                    newCloseText += "</pre>";
                }

                newOpenText = "\n" + newOpenText;
                newCloseText = newCloseText + "\n";
            }
            else
            {
                newOpenText = KARAS.encloseWithLinebreak(newOpenText) + "\n";
                newCloseText = "\n" + KARAS.encloseWithLinebreak(newCloseText);
            }
        }
        private static BlockGroupMatch constructBlockGroupMatch(int index, int textLength, string optionText)
        {
            BlockGroupMatch blockGroupMatch = new BlockGroupMatch();
            blockGroupMatch.index = index;
            blockGroupMatch.length = textLength;

            bool isSpecialOption = false;
            string[] options = KARAS.splitOptions(optionText, ref isSpecialOption);

            if (options.Length > 0)
            {
                string groupType = options[0];
                blockGroupMatch.type = getGroupType(groupType);

                if (blockGroupMatch.type == KARAS.BlockGroupTypeUndefined)
                {
                    blockGroupMatch.type = KARAS.BlockGroupTypeDiv;
                    blockGroupMatch.option = groupType;
                }
            }

            if (options.Length > 1)
            {
                blockGroupMatch.option = options[1];
            }

            return blockGroupMatch;
        }