This code writes the subtype of disc nodes to the log file.
\documentclass{minimal}
\usepackage{fontspec}
\directlua{
show_hyph = function(head)
while head do
if head.id == 0 or head.id == 1 then % hlist, vlist
show_hyph(head.head)
elseif head.id == 7 then % disc
texio.write_nl("Subtype " .. head.subtype)
end
head = head.next
end
return true
end
luatexbase.add_to_callback("post_linebreak_filter",show_hyph,"show_hyph")
}
\begin{document}
\begin{minipage}{1pt}
discretionary
\end{minipage}
\end{document}
The LuaTeX reference manual says in section 8.1.2.7 “disc nodes”
pre
<node>
pointer to the pre-break text
How do I access this?