Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
howto-cards LEGACY VERSION
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
R3
howto-cards LEGACY VERSION
Merge requests
!15
Regular merge of develop
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Regular merge of develop
develop
into
master
Overview
0
Commits
8
Pipelines
1
Changes
14
Merged
Laurent Heirendt
requested to merge
develop
into
master
5 years ago
Overview
0
Commits
8
Pipelines
1
Changes
14
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
bf4af641
8 commits,
5 years ago
14 files
+
48
−
83
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
14
Search (e.g. *.vue) (Ctrl+P)
_plugins/hook_mailto_email_protector.rb
0 → 100644
+
16
−
0
Options
Jekyll
::
Hooks
.
register
([
:pages
,
:posts
,
:documents
],
:pre_render
)
do
|
post
|
# This will run every time the website is built
# Include a plugin (needs to be in gemfile)
include
Jekyll
::
EmailProtect
::
EmailProtectionFilter
# Using a simpler version of email regexp
email_regexp
=
/mailto\:(?:[\'\"]*)(?:[\w+\-]\.?)+@[a-z\d\-]+(?:\.[a-z]+)*\.[a-z]+(?:[\'\"]*)/i
# Take post's content, and transform every occurence of the following regexp (an email)
post
.
content
=
post
.
content
.
gsub
(
email_regexp
)
{
# For every occurence, apply protection function:
|
param
|
"mailto:"
+
Jekyll
::
EmailProtect
::
EmailProtectionFilter
::
encode_email
(
param
[
7
..-
1
].
delete
(
"'"
).
delete
(
'"'
))
}
end
Loading