Skip to content

Commit a5d3d63

Browse files
authored
Merge pull request #53 from gilsonsouza/master
Fixed #33: <br/> in ncurses RichText did not behave correctly.
2 parents 512a2f9 + e766d78 commit a5d3d63

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

VERSION.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SET( VERSION_MAJOR "2" )
22
SET( VERSION_MINOR "48" )
3-
SET( VERSION_PATCH "0" )
3+
SET( VERSION_PATCH "1" )
44
SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" )
55

66
##### This is need for the libyui core, ONLY.

package/libyui-ncurses-doc.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
%define so_version 7
2020

2121
Name: %{parent}-doc
22-
Version: 2.48.0
22+
Version: 2.48.1
2323
Release: 0
2424
Source: %{parent}-%{version}.tar.bz2
2525

package/libyui-ncurses.changes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
-------------------------------------------------------------------
2+
Wed Nov 30 08:43:16 UTC 2016 - gilson.s.s@gmail.com
3+
4+
- Treat RichText non-pair tag cases (gh#libyui-ncurses/issues#33).
5+
- 2.48.1
6+
17
-------------------------------------------------------------------
28
Wed Nov 16 12:47:36 UTC 2016 - cwh@suse.com
39

package/libyui-ncurses.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
Name: libyui-ncurses
20-
Version: 2.48.0
20+
Version: 2.48.1
2121
Release: 0
2222
Source: %{name}-%{version}.tar.bz2
2323

src/NCRichText.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ void NCRichText::AdjustPrePad( const wchar_t *osch )
431431

432432
// replace <br> by \n to get appropriate lines in NCtext
433433
boost::replace_all( wtxt, L"<br>", L"\n" );
434+
boost::replace_all( wtxt, L"<br/>", L"\n" );
434435

435436
yuiDebug() << "Text: " << wtxt << " initial length: " << wch - osch << std::endl;
436437

@@ -887,6 +888,12 @@ bool NCRichText::PadTOKEN( const wchar_t * sch, const wchar_t *& ech )
887888

888889
if ( value == L"big" ) token = T_IGNORE;
889890
else if ( value == L"pre" ) token = T_PLAIN;
891+
// <br> and <hr> are the only non-pair tags currently supported.
892+
// We treat bellow these two special cases in order to work as
893+
// users expect. This issue was described at
894+
// https://github.com/libyui/libyui-ncurses/issues/33
895+
else if ( value == L"br/" ) token = T_BR;
896+
else if ( value == L"hr/" ) token = T_IGNORE;
890897

891898
break;
892899

0 commit comments

Comments
 (0)