Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/BloomExe/Spreadsheet/SpreadsheetExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Linq;
using System.Security;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using Bloom.Api;
Expand Down Expand Up @@ -409,6 +410,10 @@ var editable in translationGroup
"<span class=\"bloom-audio-split-marker\">\u200B</span>",
"|"
);
content = content.Trim(); // remove leading and trailing whitespace, which is not meaningful.
content = content.Replace("<br>", ""); // remove <br> tags which should not exist.
Comment thread
StephenMcConnel marked this conversation as resolved.
Outdated
content = content.Replace("<br />", ""); // remove <br /> tags which should not exist.
content = Regex.Replace(content, "\\s+", " "); // collapse multiple whitespace characters.
Comment thread
StephenMcConnel marked this conversation as resolved.
Outdated
Comment thread
StephenMcConnel marked this conversation as resolved.
Outdated
// Don't just test content, it typically contains paragraph markup.
if (String.IsNullOrWhiteSpace(editable.InnerText))
{
Expand Down
4 changes: 2 additions & 2 deletions src/BloomTests/Spreadsheet/SpreadsheetExporterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ public void ExportsTextOnContentPageInAllLanguages()
Assert.That(
_pageContentRows[0].GetCell("[en]").Text,
Is.EqualTo(
"Is this really a cat? The nose looks too long for it to be a cat. But perching on a limb doesn't look like a dog either. So what is it? I can't really tell from first glance!"
"Is this really a cat? The nose looks too long for it to be a cat. But perching on a limb doesn't look like a dog either. So what is it? I can't really tell from first glance!"
)
);
Assert.That(
_pageContentRows[0].GetCell("[es-x-ai-google]").Text,
Is.EqualTo(
"¿Es esto realmente un gato? La nariz parece demasiado larga para ser un gato. Pero posado sobre una rama tampoco parece un perro. Entonces, ¿qué es? ¡Realmente no puedo decirlo a primera vista!"
"¿Es esto realmente un gato? La nariz parece demasiado larga para ser un gato. Pero posado sobre una rama tampoco parece un perro. Entonces, ¿qué es? ¡Realmente no puedo decirlo a primera vista!"
)
);
}
Expand Down