#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "MetricsInfo.h"
+#include "output_xhtml.h"
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
InsetSpecialChar::InsetSpecialChar(Kind k)
- : kind_(k)
+ : Inset(0), kind_(k)
{}
}
-int InsetSpecialChar::latex(odocstream & os,
- OutputParams const & rp) const
+void InsetSpecialChar::latex(otexstream & os,
+ OutputParams const & rp) const
{
switch (kind_) {
case HYPHENATION:
os << "\\nobreakdash-";
break;
}
- return 0;
}
{
switch (kind_) {
case HYPHENATION:
- case LIGATURE_BREAK:
return 0;
+ case LIGATURE_BREAK:
+ os.put(0x200c);
+ return 1;
case END_OF_SENTENCE:
os << '.';
return 1;
os << '/';
return 1;
case NOBREAKDASH:
- os << '-';
+ os.put(0x2011);
return 1;
}
return 0;
}
-void InsetSpecialChar::xhtml(odocstream & os, OutputParams const &) const
+docstring InsetSpecialChar::xhtml(XHTMLStream & xs, OutputParams const &) const
{
switch (kind_) {
case HYPHENATION:
+ break;
case LIGATURE_BREAK:
+ xs << XHTMLStream::ESCAPE_NONE << "‌";
break;
case END_OF_SENTENCE:
- os << '.';
+ xs << '.';
break;
case LDOTS:
- os << "…";
+ xs << XHTMLStream::ESCAPE_NONE << "…";
break;
case MENU_SEPARATOR:
- os << "⇒";
+ xs << XHTMLStream::ESCAPE_NONE << "⇒";
break;
case SLASH:
- os << "⁄";
+ xs << XHTMLStream::ESCAPE_NONE << "⁄";
break;
case NOBREAKDASH:
- os << '-';
+ xs << XHTMLStream::ESCAPE_NONE << "‑";
break;
}
+ return docstring();
}
-void InsetSpecialChar::tocString(odocstream & os) const
+void InsetSpecialChar::toString(odocstream & os) const
{
plaintext(os, OutputParams(0));
}
+void InsetSpecialChar::forToc(docstring & os, size_t) const
+{
+ odocstringstream ods;
+ plaintext(ods, OutputParams(0));
+ os += ods.str();
+}
+
+
void InsetSpecialChar::validate(LaTeXFeatures & features) const
{
if (kind_ == MENU_SEPARATOR)
}
-bool InsetSpecialChar::isChar() const
-{
- return true;
-}
-
-
bool InsetSpecialChar::isLetter() const
{
- return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK;
+ return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK
+ || kind_ == NOBREAKDASH;
}
// Paragraph::stripLeadingSpaces nukes the characters which
// have this property. I leave the code here, since it should
// eventually be made to work. (JMarc 20020327)
- return kind_ == HYPHENATION || kind_ == MENU_SEPARATOR;
+ return kind_ == HYPHENATION || kind_ == MENU_SEPARATOR
+ || kind_ == SLASH;
#else
return false;
#endif