Строка 20: |
Строка 20: |
| function ctd.info( frame ) | | function ctd.info( frame ) |
| local term = '' | | local term = '' |
| + | local term_to_show = '' |
| local reference = '' | | local reference = '' |
| local description = '' | | local description = '' |
Строка 30: |
Строка 31: |
| local view = string.sub( string.lower(frame.args['userparam']), j+1 ) | | local view = string.sub( string.lower(frame.args['userparam']), j+1 ) |
| | | |
− | -- check if 'term' or 'term to show' are specified | + | -- define term to show, i.e. with accent and diacritic |
| if not isempty(frame.args['term_to_show']) then | | if not isempty(frame.args['term_to_show']) then |
− | term = frame.args['term_to_show'] | + | term_to_show = frame.args['term_to_show'] |
| elseif not isempty(frame.args['term']) then | | elseif not isempty(frame.args['term']) then |
| + | term_to_show = frame.args['term'] |
| + | else |
| + | term_to_show = text |
| + | end |
| + | -- define term in a simple form as a title in dictionary |
| + | if not isempty(frame.args['term']) then |
| term = frame.args['term'] | | term = frame.args['term'] |
| else | | else |
Строка 63: |
Строка 70: |
| end | | end |
| if view == 'сноска' or view == 'сноска и подсказка' then | | if view == 'сноска' or view == 'сноска и подсказка' then |
− | reference = '<ref>' .. term ..' ('.. origin .. ') – ' .. description .. ' (БТС, ' .. term_link .. ').</ref>' | + | reference = '<ref>' .. term_to_show ..' ('.. origin .. ') – ' .. description .. ' (БТС, ' .. term_link .. ').</ref>' |
| end | | end |
| if view == 'скобки' then | | if view == 'скобки' then |