## Copyright (C) 2022 Brodie Gaslam
##
## This file is part of "fansi - ANSI Control Sequence Aware String Functions"
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 2 or 3 of the License.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## Go to <https://www.r-project.org/Licenses> for copies of the licenses.

# two ways to terminate OSC, with an ST, or with a BELL (\a)

u0 <- sprintf(base.st, "", "", url, txt, "")

u1 <- sprintf(base.a, "", "", url, txt, "")

u2 <- sprintf(base.st, "", "id=one", url, txt, "")

u2a <- sprintf(base.st, "", "id=", url, txt, "")

u2b <- sprintf(base.st, "", "id", url, txt, "")

u3 <- sprintf(base.st, "", "title=ab:id=one", url, txt, "")

u4 <- sprintf(base.st, "", "id=one:title=ba", url, txt, "")

u6 <- sprintf(base.st, "", "id=one~title=ba", url, txt, "")

Argument `x` contains a CSI SGR sequence with unknown substrings or a OSC hyperlink with unsupported parameters at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

Warning in strwrap2_ctl(x = x, width = width, indent = indent, exdent = exdent,  :
  Argument `x` contains a CSI SGR sequence with unknown substrings or a OSC hyperlink with unsupported parameters at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.

u7 <- sprintf(base.st, "AB", "id=one", url, txt, "CD")

u8 <- sprintf(base.st, "A\033[43mB", "", url, txt2, "CD")

u9 <- sprintf(base.st, "", "", url2, txt, "")

u10 <- sprintf(base.st, "", "\a", url, txt, "")

u11a <- sprintf(base.st, "", "hello", url, txt, "")

# Unsupported parameter (only id supported), questionable whether
# this should be allowed to carry or not.

Argument `x` contains a non-CSI/OSC escape sequence at index [1], see `?unhandled_ctl`; you can use `warn=FALSE` to turn off these warnings.