public TranslationTerm( IHtmlTextNode textNode ) { TextNode = textNode; var specification = textNode.Document.HtmlSpecification; if ( !textNode.Ancestors().Any( e => e.ElementTextMode() == TextMode.Preformated ) ) SourceTerm = whitespaceRegex.Replace( textNode.HtmlText, " " ); else SourceTerm = textNode.HtmlText; }
public TranslationTerm(IHtmlTextNode textNode) { TextNode = textNode; if (!textNode.Ancestors().Any(e => HtmlSpecification.preformatedElements.Contains(e.Name, StringComparer.OrdinalIgnoreCase))) { SourceTerm = whitespaceRegex.Replace(textNode.HtmlText, " "); TranslatedTerm = whitespaceRegex.Replace(textNode.HtmlText, " "); } else { SourceTerm = textNode.HtmlText; TranslatedTerm = textNode.HtmlText; } }
public TranslationTerm( IHtmlTextNode textNode ) { TextNode = textNode; if ( !textNode.Ancestors().Any( e => HtmlSpecification.preformatedElements.Contains( e.Name, StringComparer.OrdinalIgnoreCase ) ) ) { SourceTerm = whitespaceRegex.Replace( textNode.HtmlText, " " ); TranslatedTerm = whitespaceRegex.Replace( textNode.HtmlText, " " ); } else { SourceTerm = textNode.HtmlText; TranslatedTerm = textNode.HtmlText; } }
public TranslationTerm(IHtmlTextNode textNode) { TextNode = textNode; var specification = textNode.Document.HtmlSpecification; if (!textNode.Ancestors().Any(e => e.ElementTextMode() == TextMode.Preformated)) { SourceTerm = whitespaceRegex.Replace(textNode.HtmlText, " "); } else { SourceTerm = textNode.HtmlText; } }
private static bool IsTranslatable(IHtmlTextNode textNode) { if (textNode.IsWhiteSpace()) { return(false); } if (textNode is IHtmlSpecial) { return(false); } if (textNode.Ancestors().Any(e => e.Name.EqualsIgnoreCase("partial") || e.Name.EqualsIgnoreCase("head"))) { return(false); } if (textNode.Parent() != null && HtmlSpecification.nonTextElements.Contains(textNode.Parent().Name, StringComparer.OrdinalIgnoreCase)) { return(false); } return(true); }
private static bool IsTranslatable(IHtmlTextNode textNode) { if (textNode.IsWhiteSpace()) { return(false); } if (textNode is IHtmlSpecial) { return(false); } if (textNode.Ancestors().Any(e => e.Name.EqualsIgnoreCase("partial") || e.Name.EqualsIgnoreCase("head"))) { return(false); } if (textNode.Parent() != null && textNode.ElementTextMode() == TextMode.NonText) { return(false); } return(true); }
private static bool IsTranslatable( IHtmlTextNode textNode ) { if ( textNode.IsWhiteSpace() ) return false; if ( textNode is IHtmlSpecial ) return false; if ( textNode.Ancestors().Any( e => e.Name.EqualsIgnoreCase( "partial" ) || e.Name.EqualsIgnoreCase( "head" ) ) ) return false; if ( textNode.Parent() != null && textNode.ElementTextMode() == TextMode.NonText ) return false; return true; }
private static bool IsTranslatable( IHtmlTextNode textNode ) { if ( textNode.IsWhiteSpace() ) return false; if ( textNode is IHtmlSpecial ) return false; if ( textNode.Ancestors().Any( e => e.Name.EqualsIgnoreCase( "partial" ) || e.Name.EqualsIgnoreCase( "head" ) ) ) return false; if ( textNode.Parent() != null && HtmlSpecification.nonTextElements.Contains( textNode.Parent().Name, StringComparer.OrdinalIgnoreCase ) ) return false; return true; }