diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-08-02 08:21:29 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-08-02 08:21:29 +0000 |
| commit | 61bfe2d70cae6be8c4086a210a5451135ccca9ea (patch) | |
| tree | 62bf7808b1b2bfe5f56fe1e329871fb0991d0687 /docs/tool/Modules/NaturalDocs/NDMarkup.pm | |
| parent | a13b94f9e0bca8ea892311d9d9e0c0bc48616ea7 (diff) | |
| download | zcatch-61bfe2d70cae6be8c4086a210a5451135ccca9ea.tar.gz zcatch-61bfe2d70cae6be8c4086a210a5451135ccca9ea.zip | |
added doc tool
Diffstat (limited to 'docs/tool/Modules/NaturalDocs/NDMarkup.pm')
| -rw-r--r-- | docs/tool/Modules/NaturalDocs/NDMarkup.pm | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/docs/tool/Modules/NaturalDocs/NDMarkup.pm b/docs/tool/Modules/NaturalDocs/NDMarkup.pm new file mode 100644 index 00000000..d394d2c7 --- /dev/null +++ b/docs/tool/Modules/NaturalDocs/NDMarkup.pm @@ -0,0 +1,76 @@ +############################################################################### +# +# 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 (C) 2003-2008 Greg Valure +# Natural Docs is licensed under the GPL + + +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; |