Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
footnotes
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
footnotes
Merge requests
!63
Resolve
#3486079
"Pasting update clipboard"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Resolve
#3486079
"Pasting update clipboard"
issue/footnotes-3486079:3486079-pasting-update-clipboard
into
4.0.x
Overview
0
Commits
7
Pipelines
7
Changes
3
Open
Scott Euser
requested to merge
issue/footnotes-3486079:3486079-pasting-update-clipboard
into
4.0.x
4 months ago
Overview
0
Commits
7
Pipelines
7
Changes
8
Expand
Closes
#3486079
0
0
Merge request reports
Compare
version 5
version 6
404a247d
4 months ago
version 5
0ec4f762
4 months ago
version 4
82e87f4c
4 months ago
version 3
35a9fe87
4 months ago
version 2
95b6cc36
4 months ago
version 1
80d92e69
4 months ago
4.0.x (HEAD)
and
latest version
latest version
592c61ff
7 commits,
4 months ago
version 6
404a247d
6 commits,
4 months ago
version 5
0ec4f762
5 commits,
4 months ago
version 4
82e87f4c
4 commits,
4 months ago
version 3
35a9fe87
3 commits,
4 months ago
version 2
95b6cc36
2 commits,
4 months ago
version 1
80d92e69
1 commit,
4 months ago
Show latest version
8 files
+
57
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
src/Twig/FootnotesSpacelessTwig.php
0 → 100644
+
45
−
0
Options
<?php
namespace
Drupal\footnotes\Twig
;
use
Twig\Extension\AbstractExtension
;
use
Twig\TwigFilter
;
/**
* Fallback for the Twig spaceless deprecation.
*
* This is needed because Footnotes truly does need to strip any whitespace
* around html tags to avoid extra spaces before and after inline citations.
*/
class
FootnotesSpacelessTwig
extends
AbstractExtension
{
/**
* Returns an array of twig filters to be added.
*
* @return array
* The twig filter for footnotes spaceless.
*/
public
function
getFilters
():
array
{
return
[
new
TwigFilter
(
'footnotes_spaceless'
,
[
self
::
class
,
'footnotesSpaceless'
],
[
'is_safe'
=>
[
'html'
]],
),
];
}
/**
* Removes whitespaces between HTML tags.
*
* @param string|null $content
* The content to remove whitespaces from.
*
* @return string
* The duplication of the spaceless function prior to Twig 3.12.
*/
public
static
function
footnotesSpaceless
(
?string
$content
):
string
{
return
trim
(
preg_replace
(
'/>\s+</'
,
'><'
,
$content
??
''
));
}
}
Loading