JSSM, a JavaScript state machine - the FSM for FSL
    Preparing search index...

    Function parse_fence_info

    • Parse a fence info string into a FenceDescriptor. The first token is the (already-validated) language and is ignored; remaining tokens are classified as parts, image formats, the ide macro, or the dimension options width/height (exact size) and max-width/max-height (upper bounds on natural size — see FenceDescriptor for the precedence rule when both appear on one axis). All four dimension tokens share one value syntax: a bare number (pixels), <n>px, or <n>%. Unrecognized or conflicting tokens are dropped and recorded in notes rather than throwing, so a host can render forward-compatibly.

      Parameters

      • info: string

        The full fence info string, e.g. 'fsl image code width=300'.

      Returns FenceDescriptor

      The validated descriptor; notes lists anything ignored or overridden.

      parse_fence_info('fsl').parts // => ['image', 'code']
      
      parse_fence_info('fsl code image').parts // => ['code', 'image']
      
      parse_fence_info('fsl image max-width=300 max-height=50%').max_width // => { value: 300, unit: 'px' }