diff --git a/GanjooRazor/wwwroot/css/p6.css b/GanjooRazor/wwwroot/css/p6.css index 36974716..d15a4459 100644 --- a/GanjooRazor/wwwroot/css/p6.css +++ b/GanjooRazor/wwwroot/css/p6.css @@ -301,7 +301,7 @@ div.spacer, .item, .b2 { clear: both; } -div.n { +div.n, div.l { clear: left; } diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-MySqlImports.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-MySqlImports.cs index 0fcbe58c..21371861 100644 --- a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-MySqlImports.cs +++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-MySqlImports.cs @@ -835,7 +835,10 @@ namespace RMuseum.Services.Implementation poemtext = poemtext.Replace("
", "s"); + poemtext = poemtext.Replace("
", "l"); + poemtext = poemtext.Replace("
", "p"); poemtext = poemtext.Replace("bmp", "b"); poemtext = poemtext.Replace("np", "n"); @@ -849,13 +852,14 @@ namespace RMuseum.Services.Implementation if (poemtext.Length > 0) { - int idx = poemtext.IndexOfAny(new char[] { 'a', 'b', 'm', 'n', 'p' }); + int idx = poemtext.IndexOfAny(new char[] { 'a', 'b', 'm', 'n', 'p', 's', 'l' }); bool preWasBand = false; while (idx != -1) { GanjoorVerse verse = new GanjoorVerse(); verse.PoemId = poemId; verse.VOrder = verses.Count + 1; + switch (poemtext[idx]) { case 'p': @@ -877,8 +881,16 @@ namespace RMuseum.Services.Implementation verse.VersePosition = VersePosition.CenteredVerse1; preWasBand = true; break; + case 's': + verse.VersePosition = VersePosition.Paragraph; + preWasBand = false; + break; + case 'l': + verse.VersePosition = VersePosition.Single; + preWasBand = false; + break; } - int nextIdx = poemtext.IndexOfAny(new char[] { 'a', 'b', 'm', 'n', 'p' }, idx + 1); + int nextIdx = poemtext.IndexOfAny(new char[] { 'a', 'b', 'm', 'n', 'p', 's', 'l' }, idx + 1); if (nextIdx == -1) { verse.Text = poemtext.Substring(idx + 1).Replace("یییییییییییییییییییی", "Adaptation du milieu").Replace("ببببببببب", "Empirique"); @@ -888,6 +900,8 @@ namespace RMuseum.Services.Implementation verse.Text = poemtext.Substring(idx + 1, nextIdx - idx - 1).Replace("یییییییییییییییییییی", "Adaptation du milieu").Replace("ببببببببب", "Empirique"); } + verse.Text = verse.Text.Trim(); + verses.Add(verse); idx = nextIdx; diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-SQLiteUtils.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-SQLiteUtils.cs index 69f8632e..4737d2a9 100644 --- a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-SQLiteUtils.cs +++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-SQLiteUtils.cs @@ -785,18 +785,24 @@ namespace RMuseum.Services.Implementation string[] lines = v.Text.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); + string cssClass = v.VersePosition == VersePosition.Paragraph ? "n" : "l"; + if (lines.Length != 0) { if (v.Text.Length / lines.Length < 150) { - htmlText += $"
{v.Text.Replace("\r\n", " ")}
{v.Text.Replace("\r\n", " ")}
{line}
{line}
{v.Text}