Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breaking Changes] attribute-based node protection #107

Draft
wants to merge 40 commits into
base: main
Choose a base branch
from

Commits on Apr 18, 2024

  1. testing attribute-based protection [skip ci]

    I've modified the escape-text function escape text based on wether or
    not it exists in an escapable range.
    
    This commit implements a proof of concept that protects the first
    escapable character and will not pass check.
    zkamvar committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    b45845f View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2024

  1. first working version of protected escape text.

    In this version, we no longer need to split nodes in order to protect
    them if we also want them to be continuous. I've taken the XSL template
    "escape-text" and modified it so that it takes in three new parameters:
    
    1. `pos`..........the position of the current character
    2. `protect.pos`..a space-separated list of starting positions for
       protection
    3. `protect.end`..a space-separated list of ending positions for protection
    
    I've also added three new helper templates to handle list contents:
    
    `peek` returns the top of the list, `trim` trims off the first element
    of the list (or returns the value if it's not a list), and `adjust-range`
    trims a list depending on if the current value is within range.
    
    There's a lot of printing here because I wasn't too confident with
    debugging, but based on my test in inst/extdata/xml_protect.xml, it
    produces results correctly.
    zkamvar committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    1adfd97 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f1c57ce View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2024

  1. [xml] use embedded str:tokenize function via EXSLT

    I had initially found a tokenize template and had contacted the author
    about license information (she gave permission):
    <https://exslt.github.io/str/functions/tokenize/str.tokenize.template.xsl.html>
    
    When I was working with it, I found that the function exists as part of
    libxml because it bundles EXSLT functions, which allows me to do this
    easier and more efficient by tracking and modifying a single index
    instead of a pair of strings.
    zkamvar committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    3041460 View commit details
    Browse the repository at this point in the history
  2. update comments

    zkamvar committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    31e5a0f View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2024

  1. add range updator

    zkamvar committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    90561ef View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2024

  1. Configuration menu
    Copy the full SHA
    a7b33c8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    aeb3f58 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8aa181b View commit details
    Browse the repository at this point in the history
  4. use attributes to protect curly nodes

    This will address #105
    zkamvar committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    e51eceb View commit details
    Browse the repository at this point in the history
  5. update tests

    zkamvar committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    1b9ae6a View commit details
    Browse the repository at this point in the history
  6. add NEWS; bump description

    zkamvar committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    32d2ffd View commit details
    Browse the repository at this point in the history
  7. export protection functions

    zkamvar committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    cd95f58 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a4b84fc View commit details
    Browse the repository at this point in the history
  9. add test for #105

    zkamvar committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    7c8d35b View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    fd45728 View commit details
    Browse the repository at this point in the history
  11. fix off-by-one errors

    zkamvar committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    f79c123 View commit details
    Browse the repository at this point in the history
  12. rerun snaps

    zkamvar committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    29b9b3d View commit details
    Browse the repository at this point in the history
  13. Merge branch 'fix-105-unprotect' of https://github.com/ropensci/tinkr

    …into fix-105-unprotect
    zkamvar committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    cc8ab53 View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2024

  1. Configuration menu
    Copy the full SHA
    bbc1e61 View commit details
    Browse the repository at this point in the history
  2. fix failing CI test

    The square bracket _should_ be escaped since it's outside of the
    protected range.
    zkamvar committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    b7c94ee View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b478e97 View commit details
    Browse the repository at this point in the history
  4. add comments to test file

    zkamvar committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    741fbd7 View commit details
    Browse the repository at this point in the history
  5. add protection tests

    zkamvar committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    2066ba7 View commit details
    Browse the repository at this point in the history
  6. update documentation a bit

    zkamvar committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    739020a View commit details
    Browse the repository at this point in the history
  7. document node protection

    zkamvar committed Apr 30, 2024
    Configuration menu
    Copy the full SHA
    9357b95 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2614c20 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2024

  1. Configuration menu
    Copy the full SHA
    afef059 View commit details
    Browse the repository at this point in the history
  2. add capability to split and rejoin protected nodes

    This begins to address limitations of the attribute-based protection
    by providing a way to separate and rejoin nodes that were previously
    split.
    zkamvar committed May 1, 2024
    Configuration menu
    Copy the full SHA
    54c1d1f View commit details
    Browse the repository at this point in the history
  3. fix doc booboo

    zkamvar committed May 1, 2024
    Configuration menu
    Copy the full SHA
    febfa2f View commit details
    Browse the repository at this point in the history

Commits on May 2, 2024

  1. ensure complete round trip

    The previous iteration was not quite correct because it had assumed that
    the sourcepos would match up exactly with the protection ranges, but
    these were two separate numbers.
    
    This does the following:
    
    1. when a protected range spans the entire node, then it is labeled "asis"
    2. `split_sourcepos()` now reflects the actual end of the sourcepos
       instead of the computed end
    3. an awkward catch for single nodes in `join_split_nodes()` is now
       eliminated
    4. `join_split_nodes()` no longer re-comuputes the protected ranges from
       the sourcepos
    zkamvar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    7061241 View commit details
    Browse the repository at this point in the history
  2. add find_between_nodes from pegboard

    This allows us to search for internal nodes using their identities
    zkamvar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    9e7de72 View commit details
    Browse the repository at this point in the history
  3. use helpers for asis

    zkamvar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    acd560f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f22d2aa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7875dea View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    37332f7 View commit details
    Browse the repository at this point in the history
  7. fix typo

    zkamvar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    bb0032c View commit details
    Browse the repository at this point in the history
  8. simplify node joinery

    zkamvar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    4db2189 View commit details
    Browse the repository at this point in the history
  9. update tests for curly

    zkamvar committed May 2, 2024
    Configuration menu
    Copy the full SHA
    37fc979 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2024

  1. Configuration menu
    Copy the full SHA
    6a6b3bc View commit details
    Browse the repository at this point in the history