Merged in tk0miya/sphinx (pull request #304)

numfig feature improvement
This commit is contained in:
Takayuki Shimizukawa
2014-10-06 21:45:25 +09:00
6 changed files with 319 additions and 273 deletions

View File

@@ -52,8 +52,11 @@ def test_code_block_dedent(app, status, warning):
@with_app('html', testroot='directive-code')
def test_code_block_caption_html(app, status, warning):
app.builder.build(['caption'])
html = (app.outdir / 'caption.html').text()
caption = '<div class="code-block-caption">caption <em>test</em> rb</div>'
html = (app.outdir / 'caption.html').text(encoding='utf-8')
caption = (u'<div class="code-block-caption">'
u'<span class="caption-text">caption <em>test</em> rb'
u'</span><a class="headerlink" href="#id1" '
u'title="Permalink to this code">\xb6</a></div>')
assert caption in html
@@ -98,8 +101,11 @@ def test_literal_include_dedent(app, status, warning):
@with_app('html', testroot='directive-code')
def test_literalinclude_caption_html(app, status, warning):
app.builder.build('index')
html = (app.outdir / 'caption.html').text()
caption = '<div class="code-block-caption">caption <strong>test</strong> py</div>'
html = (app.outdir / 'caption.html').text(encoding='utf-8')
caption = (u'<div class="code-block-caption">'
u'<span class="caption-text">caption <strong>test</strong> py'
u'</span><a class="headerlink" href="#id2" '
u'title="Permalink to this code">\xb6</a></div>')
assert caption in html