Skip to content

Award explanations render only the first digit of a multi-digit subscript #1343

Description

@gemshrine

Award explanations convert a digit suffix on a symbol to a Unicode subscript, but the conversion matches only one digit. Symbols with multi-digit suffixes therefore render partly as normal text.

Steps to reproduce:

  1. Use a valid Factbase symbol with a multi-digit suffix, such as foo10, in an award expression.
  2. Generate the award bill or bylaw containing that expression.

Actual result: Fbe::Award::PTerm#to_p applies /([a-z]+)([0-9])/, so foo10 is rendered as foo₁0 and rate23 as rate₂3. The displayed variable no longer follows the subscript convention used for digit suffixes and can be confused with a different symbol.

Expected result: convert every digit in a numeric suffix, for example rendering foo10 as foo₁₀ and rate23 as rate₂₃.

Technical evidence: lib/fbe/award.rb converts symbols through PTerm#to_p when generating human-readable award text, but the regular expression captures a single digit. Factbase's symbol grammar allows a sequence of digits after the initial letter, so these are valid inputs, not malformed expressions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions