示例#1
0
        public void MapCssToLang_UsesGetValidCssClassName()
        {
            var helper = new XhtmlHelper();

            helper.MapCssToLang("#MyClass", "dummy");
            List <string> output;

            Assert.That(helper.TryGetLangsFromCss("#MyClass", out output), Is.True, "unmodified class name should retrieve successfully");
            Assert.That(helper.TryGetLangsFromCss("NUMBER_SIGNMyClass", out output), Is.True, "corrected class name should also work");
        }
示例#2
0
        private void ExportBook(IScrBook book, IAdvInd4 progressDlg)
        {
            m_writer.WriteLine("<div class=\"scrBook\">");
            m_xhtml.MapCssToLang("scrBook", LanguageCode(m_cache.DefaultVernWs));
            ExportBookTitle(book);
            int iFirst = 0;
            int iLim   = book.SectionsOS.Count;

            if (m_what == ExportWhat.SingleBook)
            {
                iFirst = m_iFirstSection;
                iLim   = m_iLastSection + 1;
            }
            bool fColumnOutput = false;

            for (int i = iFirst; i < iLim; ++i)
            {
                if (!book.SectionsOS[i].IsIntro && !fColumnOutput)
                {
                    m_writer.WriteLine("<div class=\"columns\">");
                    m_xhtml.MapCssToLang("columns", LanguageCode(m_cache.DefaultVernWs));
                    fColumnOutput = true;
                }
                ExportBookSection(book.SectionsOS[i]);
                if (m_cancel)
                {
                    break;
                }
                progressDlg.Step(0);
            }
            if (fColumnOutput)
            {
                m_writer.WriteLine("</div>");                   // matches <div class="columns">
            }
            m_writer.WriteLine("</div>");                       // matches <div class="scrBook">
        }