mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-22 11:54:54 +00:00
Add util/write-dev-docs, util/extract-package, and docs/dev/.
This commit is contained in:
77
util/NaturalDocs/Modules/NaturalDocs/NDMarkup.pm
Normal file
77
util/NaturalDocs/Modules/NaturalDocs/NDMarkup.pm
Normal file
@@ -0,0 +1,77 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Package: NaturalDocs::NDMarkup
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# A package of support functions for dealing with <NDMarkup>.
|
||||
#
|
||||
# Usage and Dependencies:
|
||||
#
|
||||
# The package doesn't depend on any Natural Docs packages and is ready to use right away.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
# This file is part of Natural Docs, which is Copyright <20> 2003-2010 Greg Valure
|
||||
# Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL)
|
||||
# Refer to License.txt for the complete details
|
||||
|
||||
|
||||
use strict;
|
||||
use integer;
|
||||
|
||||
package NaturalDocs::NDMarkup;
|
||||
|
||||
#
|
||||
# Function: ConvertAmpChars
|
||||
#
|
||||
# Substitutes certain characters with their <NDMarkup> amp chars.
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# text - The block of text to convert.
|
||||
#
|
||||
# Returns:
|
||||
#
|
||||
# The converted text block.
|
||||
#
|
||||
sub ConvertAmpChars #(text)
|
||||
{
|
||||
my ($self, $text) = @_;
|
||||
|
||||
$text =~ s/&/&/g;
|
||||
$text =~ s/</</g;
|
||||
$text =~ s/>/>/g;
|
||||
$text =~ s/\"/"/g;
|
||||
|
||||
return $text;
|
||||
};
|
||||
|
||||
|
||||
#
|
||||
# Function: RestoreAmpChars
|
||||
#
|
||||
# Replaces <NDMarkup> amp chars with their original symbols.
|
||||
#
|
||||
# Parameters:
|
||||
#
|
||||
# text - The text to restore.
|
||||
#
|
||||
# Returns:
|
||||
#
|
||||
# The restored text.
|
||||
#
|
||||
sub RestoreAmpChars #(text)
|
||||
{
|
||||
my ($self, $text) = @_;
|
||||
|
||||
$text =~ s/"/\"/g;
|
||||
$text =~ s/>/>/g;
|
||||
$text =~ s/</</g;
|
||||
$text =~ s/&/&/g;
|
||||
|
||||
return $text;
|
||||
};
|
||||
|
||||
|
||||
1;
|
Reference in New Issue
Block a user