-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix appendTitle, prependTitle. Update unit test for append, prepend and setTitle. #12236
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
cce5104
Update unit test for prepend/ append/ getTitle
borisdelev a4bf6bb
Switch function for getTitle
borisdelev 8269ae4
Update appendTitle and prependTitle in tag.zep
borisdelev 59050c7
Update unit test for prepend / append
borisdelev 5368658
Try to fix prependTitle / appendTitle
borisdelev 539b03c
Try to improve prependTitle & appendTitle
borisdelev 821dd75
Try to improve prependTitle & appendTitle
borisdelev ccc5638
Try to improve prependTitle & appendTitle
borisdelev f0237ea
Try to improve prependTitle & appendTitle (return)
borisdelev 1780843
Fix new line in test for setTitle
borisdelev 4ecd3fa
Check and try to improve prependTitle
borisdelev 6729606
Now complete both prepend and append
borisdelev d7c8d3c
Just one more check.
borisdelev 2a49c8d
fix
borisdelev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1061,17 +1061,51 @@ class Tag | |
/** | ||
* Appends a text to current document title | ||
*/ | ||
public static function appendTitle(string title) -> void | ||
public static function appendTitle(var title) -> void | ||
{ | ||
let self::_documentAppendTitle = title; | ||
var append = []; | ||
if self::_documentAppendTitle !== null { | ||
let append = self::_documentAppendTitle ; | ||
} | ||
|
||
if typeof title == "array" { | ||
let append = title; | ||
} else { | ||
if typeof title == "string" { | ||
let append[] = title; | ||
} | ||
} | ||
|
||
if empty append { | ||
let append = null ; | ||
} | ||
|
||
let self::_documentAppendTitle = append ; | ||
} | ||
|
||
/** | ||
* Prepends a text to current document title | ||
*/ | ||
public static function prependTitle(string title) -> void | ||
public static function prependTitle(var title) -> void | ||
{ | ||
let self::_documentPrependTitle = title; | ||
var prepend = []; | ||
if self::_documentPrependTitle !== null { | ||
let prepend = self::_documentPrependTitle ; | ||
} | ||
|
||
if typeof title == "array" { | ||
let prepend = title; | ||
} else { | ||
if typeof title == "string" { | ||
array_unshift(prepend, title) ; | ||
} | ||
} | ||
|
||
if empty prepend { | ||
let prepend = null ; | ||
} | ||
|
||
let self::_documentPrependTitle = prepend ; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So now |
||
} | ||
|
||
/** | ||
|
@@ -1093,21 +1127,21 @@ class Tag | |
let escaper = <EscaperInterface> self::getEscaper(["escape": true]); | ||
let items = []; | ||
let output = ""; | ||
let documentPrependTitle = escaper->escapeHtml(self::_documentPrependTitle); | ||
let documentPrependTitle = self::_documentPrependTitle; | ||
let documentTitle = escaper->escapeHtml(self::_documentTitle); | ||
let documentAppendTitle = escaper->escapeHtml(self::_documentAppendTitle); | ||
let documentAppendTitle = self::_documentAppendTitle; | ||
let documentTitleSeparator = escaper->escapeHtml(self::_documentTitleSeparator); | ||
|
||
if !empty documentPrependTitle { | ||
let items[] = documentPrependTitle; | ||
let items[] = escaper->escapeHtml(implode(documentTitleSeparator, documentPrependTitle)); | ||
} | ||
|
||
if !empty documentTitle { | ||
let items[] = documentTitle; | ||
} | ||
|
||
if !empty documentAppendTitle { | ||
let items[] = documentAppendTitle; | ||
let items[] = escaper->escapeHtml(implode(documentTitleSeparator, documentAppendTitle)); | ||
} | ||
|
||
if empty documentTitleSeparator { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is new feature request?