# Why does using small caps break endash ligatures in lualatex?

I've spent most of my day trying to migrate a project from pdftex tolualatex. The experience has been mostly positive but there are a few gotchas I can't make heads or tails of.

Most recently I've just noticed that the standard texish ligatures for endash and emdash (i.e -- is typeset as – and --- becomes —) have gone A.W.O.L on me when located in small caps formatted references. This is unfortunate as I use endash in Bible verse references that are typeset in the margins using small-caps.

I have reviewed the info in How to enable ligatures for emdash/endash in LuaTeX ? but this seems to be a different issue.

Here is a MWE showing the issue (compile with lualatex):

\documentclass{scrartcl}
\usepackage{luatextra}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Linux Libertine}

\begin{document}
Test -- endash and --- emdash

{\scshape Test -- endash and --- emdash}
\end{document}


Which for me produces:

What is the culprit here and how do I fix it?

-
I can confirm it; and it doesn't happen with TeX Live 2012, so I think it's a bug in luaotfload –  egreg May 10 at 23:08
I do not have Linux Libertine installed. However I tested with Latin Modern and Minion Pro; it compiles and shows no problem. I suppose it's specifically a problem with Linux Libertine. –  Bernard May 10 at 23:13
using TL2014 it doesn't find the font under that name  \setmainfont{LinLibertine_R} works but shows -- as you report. However if you use {\scshape Test – endash and — emdash} with the characters directly then it works. –  David Carlisle May 11 at 0:34
Reported. –  phg May 11 at 10:24
Hans fixed it. The new code will be part of the next version of Luaotfload. –  phg May 12 at 17:28

The bug fix has been released to CTAN as of the v2.5-1 release.

\documentclass{scrartcl}
\usepackage{luatextra}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Linux Libertine}

\begin{document}
Test -- endash and --- emdash

{\scshape Test -- endash and --- emdash}
\end{document}


with

luaotfload.sty 2014/07/16 v2.5-1 OpenType layout system`

gives

-