diff --git a/fc-solve/site/wml/Tests/content-script-tag-hyperlinks.py b/fc-solve/site/wml/Tests/content-script-tag-hyperlinks.py index 731dc23e0..5f351d32a 100644 --- a/fc-solve/site/wml/Tests/content-script-tag-hyperlinks.py +++ b/fc-solve/site/wml/Tests/content-script-tag-hyperlinks.py @@ -12,9 +12,6 @@ class MyTests(unittest.TestCase): def test_main(self): - def _count_jquery_ui(root): - return len(root.xpath( - ".//script[contains(@src, 'js/jquery-ui/jquery-ui.min.js')]")) input_fn = './dest/js-fc-solve/text/index.html' with open(input_fn, "rb") as fh: root = etree.HTML(fh.read()) @@ -31,6 +28,25 @@ def _count_jquery_ui(root): [], "all are ok") + def test_individual_faq_pages(self): + input_fn = './dest/faq-indiv-nodes/a_move_seems_wrong.xhtml' + with open(input_fn, "rb") as fh: + root = etree.HTML(fh.read()) + matches = root.xpath( + ".//link[ @rel = 'stylesheet' and @media = 'screen' and @href]" + ) + filtered = [] + for x in matches: + m = re.match('^((?:\\.\\./)*style.css)\\Z', x.get('href')) + if m: + filtered.append(m.group(1)) + + self.assertTrue(len(filtered), "matches") + self.assertEqual( + [x for x in filtered if re.match('\\.\\./\\.\\./', x)], + [], + "all are ok") + if __name__ == '__main__': from pycotap import TAPTestRunner diff --git a/fc-solve/site/wml/lib/split-html/faq_splitter_prog.py b/fc-solve/site/wml/lib/split-html/faq_splitter_prog.py index 31e3f919c..b0476bb09 100644 --- a/fc-solve/site/wml/lib/split-html/faq_splitter_prog.py +++ b/fc-solve/site/wml/lib/split-html/faq_splitter_prog.py @@ -129,6 +129,7 @@ def _faq_gen(dest_dir): splitter = XhtmlSplitter( **COMMON_TITLE_CALLBACKS, back_to_source_page_css_class=BACK_TO_SOURCE_PAGE_CSS_CLASS, + base_path="../", individual_node_css_class=INDIVIDUAL_NODE_CSS_CLASS, input_fn=input_fn, output_dirname=OUT_DN,