\input regression-test.tex
\documentclass{article}
\usepackage{osgstyler}

\DeclareOsgFontPalette{test}{
  main = {font = {Latin Modern Roman}},
  accent = {font = {Latin Modern Sans}},
  mono = {alias = main}
}
\DeclareOsgColorPalette{test}{
  primary = {model=HTML, value=223344},
  text = {model=HTML, value=111111},
  accent = {model=HTML, value=CC5500}
}
\DeclareOsgDecoration{marker}{
  background = {color = accent, opacity = {.2}, shape = text}
}

\DeclareOsgInlineStyle{important}{
  font = accent,
  color = accent,
  decoration = marker,
  semantics = emphasis
}
\DeclareOsgInlineStyle{plain}{
  font = none,
  color = none
}
\DeclareOsgInlineStyle{broken}{
  font = none,
  color = none,
  decoration = missing,
  semantics = none
}

\ExplSyntaxOn
\cs_new_protected:Npn \__osgstyler_test_semantics:nn #1#2
  { \TYPE{semantics=#1} #2 }
\cs_new_protected:Npn \__osgstyler_test_decoration:nn #1#2
  { \TYPE{decoration=#1} \TYPE{content=#2} }
\cs_new_eq:NN \TestSemanticProcessor \__osgstyler_test_semantics:nn
\cs_new_eq:NN \TestDecorationProcessor \__osgstyler_test_decoration:nn
\ExplSyntaxOff

\begin{document}
\UseOsgFontPalette{test}
\UseOsgColorPalette{test}
\SetOsgSemanticProcessor{\TestSemanticProcessor}
\SetOsgDecorationProcessor{\TestDecorationProcessor}
% unknown-decoration-for-style must not halt compilation; the content
% still comes through, just without the (missing) decoration applied.
% Triggered before \START so the resulting error message does not
% become part of the diffed log.
\setbox0=\hbox{\UseOsgInlineStyle{broken}{unstyled}}
\START
\TYPE{broken-style-recovered=yes}
\UseOsgInlineStyle{important}{Alpha}
\TYPE{plain-before}
\UseOsgInlineStyle{plain}{Beta}
\TYPE{plain-after}
\END
\end{document}
