mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-12-16 06:25:31 +00:00
Mergess TraditionRules with TextRules. Added tabs for other Text. Some bugs persist see readme
This commit is contained in:
@@ -9,7 +9,7 @@ using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class LetterState : HaWeb.HTMLParser.IState {
|
||||
public class TextState : HaWeb.HTMLParser.IState {
|
||||
// Input
|
||||
internal ILibrary Lib;
|
||||
internal IReaderService ReaderService;
|
||||
@@ -43,12 +43,12 @@ public class LetterState : HaWeb.HTMLParser.IState {
|
||||
internal bool activelinecount;
|
||||
|
||||
// Results
|
||||
internal StringBuilder sb_lettertext;
|
||||
internal StringBuilder sb;
|
||||
internal List<(string, string, string)>? ParsedMarginals;
|
||||
internal string? Startline;
|
||||
internal string? Startpage = null;
|
||||
|
||||
public LetterState(ILibrary lib, IReaderService readerService, Meta meta, IEnumerable<Marginal>? marginals, IEnumerable<Hand>? hands, IEnumerable<Editreason>? edits) {
|
||||
public TextState(ILibrary lib, IReaderService readerService, Meta meta, IEnumerable<Marginal>? marginals, IEnumerable<Hand>? hands, IEnumerable<Editreason>? edits) {
|
||||
Lib = lib;
|
||||
ReaderService = readerService;
|
||||
Meta = meta;
|
||||
@@ -60,7 +60,7 @@ public class LetterState : HaWeb.HTMLParser.IState {
|
||||
|
||||
|
||||
public void SetupState() {
|
||||
sb_lettertext = new StringBuilder();
|
||||
sb = new StringBuilder();
|
||||
active_skipwhitespace = true;
|
||||
currline = "-1";
|
||||
mustwrap = (false, false);
|
||||
@@ -1,55 +0,0 @@
|
||||
namespace HaWeb.Settings.ParsingState;
|
||||
using System.Text;
|
||||
using HaXMLReader.Interfaces;
|
||||
using HaDocument.Models;
|
||||
using HaDocument.Interfaces;
|
||||
using System.Collections.Immutable;
|
||||
|
||||
public class TraditionState : HaWeb.HTMLParser.IState {
|
||||
|
||||
internal ILibrary Lib;
|
||||
internal IReaderService ReaderService;
|
||||
|
||||
internal IEnumerable<Marginal>? Marginals;
|
||||
internal IEnumerable<Hand>? Hands;
|
||||
internal IEnumerable<Editreason>? Edits;
|
||||
|
||||
// State
|
||||
// Must we skip all of the upcoming whitespace?
|
||||
internal bool active_skipwhitespace;
|
||||
// Is there a semantically important line break, left or right of the current line?
|
||||
internal (bool, bool) mustwrap;
|
||||
// What's the current line?
|
||||
internal string currline;
|
||||
// What's the current page?
|
||||
internal string currpage;
|
||||
// Does the container need a min-widt, so percentages are useful (tables)
|
||||
internal bool minwidth;
|
||||
// Is there an active_zhtext
|
||||
internal bool active_trad;
|
||||
|
||||
internal StringBuilder sb_tradition; // Überlieferung
|
||||
internal List<(string, string, string)>? ParsedMarginals;
|
||||
internal string Startline;
|
||||
|
||||
internal IReader rd_tradition;
|
||||
|
||||
public TraditionState(ILibrary lib, IReader reader, IReaderService readerService, IEnumerable<Marginal>? marginals, IEnumerable<Hand>? hands, IEnumerable<Editreason>? edits) {
|
||||
Lib = lib;
|
||||
rd_tradition = reader;
|
||||
Marginals = marginals;
|
||||
ReaderService = readerService;
|
||||
Hands = hands;
|
||||
Edits = edits;
|
||||
SetupState();
|
||||
}
|
||||
|
||||
public void SetupState() {
|
||||
sb_tradition = new StringBuilder();
|
||||
|
||||
active_trad = false;
|
||||
active_skipwhitespace = true;
|
||||
currline = "-1";
|
||||
currpage = string.Empty;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user