]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSqrt.cpp
HTML for roots.
[lyx.git] / src / mathed / InsetMathSqrt.cpp
index f738e2c17bc516db242b681850146839f7050244..e27475ed1484a0575e088870abf02e864deda0d5 100644 (file)
@@ -11,6 +11,8 @@
 #include <config.h>
 
 #include "InsetMathSqrt.h"
+
+#include "LaTeXFeatures.h"
 #include "MathData.h"
 #include "MathStream.h"
 #include "TextPainter.h"
@@ -113,4 +115,21 @@ void InsetMathSqrt::mathmlize(MathStream & os) const
 }
 
 
+void InsetMathSqrt::htmlize(HtmlStream & os) const
+{
+       os << MTag("span", "class='sqrt'")
+          << from_ascii("&radic;") 
+          << MTag("span", "class='sqrtof'")    << cell(0) << ETag("span") 
+                << ETag("span");
+}
+
+
+void InsetMathSqrt::validate(LaTeXFeatures & features) const
+{
+       if (features.runparams().math_flavor == OutputParams::MathAsHTML)
+               features.addPreambleSnippet("<style type=\"text/css\">\n"
+                       "span.sqrtof{border-top: thin solid black;}\n"
+                       "</style>");
+}
+
 } // namespace lyx