logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

MsOffice::Word::Surgeon::Utils - utility functions for MsOffice::Word::Surgeon

Description

       Functions in this module are used internally by MsOffice::Word::Surgeon.

Functions

maybe_preserve_spaces
         my $attr = maybe_preserve_spaces($some_text);

       Returns the XML attribute to be inserted into "<w:t>" nodes and "<w:delText>" nodes when the literal text
       within the node starts or ends with a space -- in that case the XML should contain the attribute
       "xml:space="preserve""

   is_at_run_level
          if (is_at_run_level($xml)) {...}

       Returns true if the given XML fragment ends with a "</w:r>", "</w:del>" or "</w:ins>" node.

   parse_attrs
         my %attrs = parse_attrs($lst_attrs)

       Returns a hash of name-value pairs parsed from the input string.  Values may be enclosed in single or in
       double quotes.  Values are entity-decoded.

   decode_entities
         decode_entities($string)

       Decodes XML entities within the supplied string (in-place decoding).

   encode_entities
         encode_entities($string)

       Encodes XML entities within the supplied string (in-place encoding).

Name

       MsOffice::Word::Surgeon::Utils - utility functions for MsOffice::Word::Surgeon

Synopsis

         use MsOffice::Word::Surgeon::Utils qw(maybe_preserve_spaces);
         my $attr = maybe_preserve_spaces($some_text);

See Also