Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
f515db7f
Commit
f515db7f
authored
8 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
fix problems with header that look falsy. fixes #1770
parent
d5c0422f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_test/tests/inc/parser/renderer_xhtml.test.php
+16
-0
16 additions, 0 deletions
_test/tests/inc/parser/renderer_xhtml.test.php
inc/parser/xhtml.php
+2
-2
2 additions, 2 deletions
inc/parser/xhtml.php
with
18 additions
and
2 deletions
_test/tests/inc/parser/renderer_xhtml.test.php
+
16
−
0
View file @
f515db7f
...
...
@@ -248,4 +248,20 @@ class renderer_xhtml_test extends DokuWikiTest {
'
;
$this
->
assertEquals
(
$expected
,
$this
->
R
->
doc
);
}
public
function
test_blankHeader
()
{
$this
->
R
->
header
(
'0'
,
1
,
1
);
$expected
=
'<h1 class="sectionedit1" id="section0">0</h1>'
;
$this
->
assertEquals
(
$expected
,
trim
(
$this
->
R
->
doc
));
}
public
function
test_blankTitleLink
()
{
global
$conf
;
$conf
[
'useheading'
]
=
1
;
saveWikiText
(
'test'
,
'====== 0 ======'
,
'test'
);
$this
->
R
->
internallink
(
'test'
);
$expected
=
'<a href="/./doku.php?id=test" class="wikilink1" title="test">0</a>'
;
$this
->
assertEquals
(
$expected
,
trim
(
$this
->
R
->
doc
));
}
}
This diff is collapsed.
Click to expand it.
inc/parser/xhtml.php
+
2
−
2
View file @
f515db7f
...
...
@@ -191,7 +191,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
function
header
(
$text
,
$level
,
$pos
)
{
global
$conf
;
if
(
!
$text
)
return
;
//skip empty headlines
if
(
blank
(
$text
)
)
return
;
//skip empty headlines
$hid
=
$this
->
_headerToLink
(
$text
,
true
);
...
...
@@ -1688,7 +1688,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
}
elseif
(
is_null
(
$title
)
||
trim
(
$title
)
==
''
)
{
if
(
useHeading
(
$linktype
)
&&
$id
)
{
$heading
=
p_get_first_heading
(
$id
);
if
(
$heading
)
{
if
(
!
blank
(
$heading
)
)
{
return
$this
->
_xmlEntities
(
$heading
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment