I want to put a QR code together with a counter and a text. I have defined a command, \qrblock, which to vertically align all elements uses a table (tblr). I want all the elements to be aligned at the top of the cell. When the text is long, an incorrect vertical space appears.
Any suggestions?
Thanks in advance
Here is a mwe.
\documentclass[10pt,twoside,openrigth,numbers=noenddot]{book}
\usepackage{iftex}
\ifLuaTeX
% ⟨material for LuaTEX⟩
\let\pdfsavepos\savepos
\let\pdflastxpos\lastxpos
\let\pdflastypos\lastypos
\else
% ⟨material not for LuaTEX⟩
\fi
\usepackage{tabularray}
\usepackage{blindtext}
\usepackage[hyperlinks]{qrcode}
\newcounter{qrcounter}
\counterwithin{qrcounter}{section}
\newcommand{\qrblock}[2]{%
\stepcounter{qrcounter}
\setlength{\parindent}{0pt}
\begin{tblr}{
width = 0.5\linewidth,
colspec = {Q[b,c]X[h,l]},
hspan = minimal,
hline{1-2} = {}, % only for testing
}
\qrcode[height=0.5in]{#1}%
& \textsf{\small QR \theqrcounter\\ #2 }%
\end{tblr}
}
\begin{document}
\chapter{Chapter}
\section{Section}
\blindtext
\qrblock{https://tex.stackexchange.com}{Lorem ipsum (Correct)}%
\qrblock{https://tex.stackexchange.com}{Lorem ipsum dolor sit amet, consectetuer (Correct)}%
\qrblock{https://tex.stackexchange.com}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit consectetuer adipiscing elit (Incorrect)}%
\section{Another section}
\blindtext
\end{document}

