DOKK / manpages / debian 13 / libmsoffice-word-surgeon-perl / MsOffice::Word::Surgeon::Utils.3pm.en
MsOffice::Word::Surgeon::Utils(3pm) User Contributed Perl Documentation MsOffice::Word::Surgeon::Utils(3pm)

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

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

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

  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""

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

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

  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($string)

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

  encode_entities($string)

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

Copyright 2019-2024 by Laurent Dami.

This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.

2025-05-16 perl v5.40.1