Skip to content

Sometimes problem with 'orphaned' spaces #45

Open
@ghost

Description

Sometimes the HtmlFromXamlConverter misses whitespace because it is not in a <Run> or similar tag. I hacked a fix by inserting the following code at line 46 of HtmlFromXamlConverter.cs:

            string regex = @"\>[ ]{1,}\<(?!\/)";
            Match m = Regex.Match(xamlString, regex);
            while (m != null && m.Success)
            {
                xamlString =
                      xamlString.Substring(0, m.Index + 1)
                    + "<Run xml:space='preserve'>" + new String(' ', m.Length - 2) + "</Run>"
                    + xamlString.Substring(m.Index + m.Length - 1, xamlString.Length - (m.Index + m.Length - 1));
                m = Regex.Match(xamlString, regex);
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions