1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00
Commit Graph

501 Commits

Author SHA1 Message Date
Witold Filipczyk
5f87bdbcb2 [meson] meson build scripts.
Not finished yet, but I added to motivate myself and others.
The goal is to get a few seconds faster builds.

autotools still will be available.
2020-09-05 22:06:01 +02:00
Witold Filipczyk
3d96b0d7d7 Revert "Compile with C++."
This reverts commit 4f4df33638.
2019-04-21 12:27:40 +02:00
Witold Filipczyk
4f4df33638 Compile with C++.
Weak points:
- alignof
- js problems

Todo:
- make js work with C++ and mozjs-17
- then mozjs-24
- then mozjs-52
- then mozjs-60
- decrease number of warnings
2019-02-17 20:46:16 +01:00
أحمد المحمودي (Ahmed El-Mahmoudy)
dbab898f38 Fix spelling mistakes 2019-01-14 04:51:10 +01:00
Witold Filipczyk
6dfdd36398 form_control -> el_form_control 2018-09-09 19:18:53 +02:00
Witold Filipczyk
d8be2c505e Rename struct box to struct el_box.
In the future I want to copy some code from netsurf, so I'm preparing.
2018-09-09 19:14:56 +02:00
Witold Filipczyk
3b279e5ec6 No warning 2018-03-10 10:36:25 +01:00
rkd77
d539a45c98
Merge pull request #3 from aelmahmoudy/color_link_num
Allow link number colors to be changed.
2017-11-26 10:58:04 +01:00
Witold Filipczyk
48ba074969 mem_free_set instead two lines 2017-11-23 10:33:10 +01:00
rkd77
be719e1ac1
Merge pull request #10 from aelmahmoudy/select_forms
Make select forms look more like other forms.
2017-11-22 12:02:06 +01:00
rkd77
77ea5759ed
Merge pull request #9 from aelmahmoudy/preferred_document_width_option
Add preferred_document_width option.
2017-11-22 11:59:17 +01:00
rkd77
addd051c97
Merge pull request #6 from aelmahmoudy/dont_underline_unselected_forms
Dont underline unselected forms
2017-11-22 11:54:50 +01:00
rkd77
2b786ac7fe
Merge pull request #2 from aelmahmoudy/underline_links
Underline links even in numbered links mode
2017-11-22 11:42:02 +01:00
Nils Dagsson Moskopp
aae79c95fe Add rendering for html source element 2017-11-22 03:19:33 +01:00
Yozo Hida
49988d305f Do not underline forms (unless selected). 2017-11-22 01:16:50 +01:00
Yozo Hida
948d019fc0 Add preferred_document_width option.
Option document.browse.preferred_document_width controls the
width of the document, so that documents are rendered with narrower
width than screen width.  Makes it easier to read paragraphs.

Patch originally from Shalon Wood <dstar@pele.cx>, see bug #1063.

Instead of using max_document_width as the hard limit to the document
width, it uses a soft limit, where if the document does not fit (due to
tables, etc.), then larger width is used.  This reduces the need for
horizontal scrolling for wide documents.

Also added toggle-document-width action to toggle between preferred
width and full screen width.  This is bound to 'M' by default.  Initial
toggle status is determined by document.browse.use_preferred_document_width
option.

During dumps, document.dump.width option is still used.  Perhaps we
should consolidate document.dump.width option with
document.browse.preferred_document_width ?
2017-11-21 16:09:13 +01:00
Yozo Hida
7e58737619 Make select forms look more like other forms.
Insert "[_" and "_]" as part of the form link, and
include it as part of the link.
2017-11-21 16:06:33 +01:00
Yozo Hida
a4d8f25a9c Allow link number colors to be changed.
These settings are specified by

  document.colors.link_number
  document.colors.use_link_number_color

The latter setting determines whether the color is used when document
colors are being used.

See bug #1050.
2017-11-21 15:56:32 +01:00
Yozo Hida
468e7aaff9 Underline links even in numbered links mode 2017-11-21 15:50:23 +01:00
Marco Migliori
5e31308da0 text direction mark 2017-05-16 20:57:25 +02:00
Witold Filipczyk
257422f28c Reorganisation of code to make C++ happy 2016-04-20 22:21:31 +02:00
Witold Filipczyk
da15322705 Cast to (const char *) in strrchr calls 2016-04-20 21:03:27 +02:00
Witold Filipczyk
96e65c105f Explicit cast in strstr for C++ 2016-04-20 20:46:33 +02:00
Witold Filipczyk
1b06539694 Explicit cast to (const char *) in strcasestr for C++ 2016-04-20 20:11:08 +02:00
Witold Filipczyk
52d6f37c8e Explicit cast to (const char *) for strchr function (C++) 2016-04-20 19:43:37 +02:00
Witold Filipczyk
67673f5fe5 new -> new_ for C++ compatibility 2016-04-20 18:42:22 +02:00
Witold Filipczyk
f4981bb553 class -> class_ for C++ compatibility 2016-04-20 18:18:27 +02:00
Witold Filipczyk
2e721e051a template -> template_ for C++ compatibility 2016-04-20 18:05:00 +02:00
Fabienne Ducroquet
13f3da8416 Improve isolated combining characters handling
If there are isolated combining characters, e.g. at the beginning of a paragraph
or table cell:
– if it’s not the first screen column, combine them with whatever character is
printed to their left;
– otherwise, add a no-break space as the base character.

Previously, such combining characters were combined with the last letter
displayed, i.e. the last letter of the previous paragraph or cell.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2016-04-12 21:59:50 +02:00
Fabienne Ducroquet
a43ec1075c Display combining characters at the end of the current string in set_hline
without waiting for the next non zero width character. This way combining
characters at the end of the document are displayed.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2016-04-12 21:58:54 +02:00
Fabienne Ducroquet
c1140f54c4 Compute correct number of cells with CONFIG_COMBINE
Otherwise, there are unnecessary spaces at the end of lines in tables containing
combining characters.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2016-04-12 21:41:53 +02:00
Fabienne Ducroquet
ec30a09a36 Bug 1139: Fix internal error: "bad split" with CONFIG_COMBINE
A combining character sequence where the base character is a space remained
recorded as a space although the initial space was replaced with an internal
code corresponding to the combined character. This caused an internal error when
ELinks tried to split the line at that place and did not find the space.

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2016-04-12 21:41:49 +02:00
Witold Filipczyk
4efea7e314 Added support for label_key in references of dumps.
Added base parameter to dec2qwerty and qwerty2dec to avoid strlen calls
im dumps.
2016-02-07 11:51:17 +01:00
Witold Filipczyk
69986f1bd1 Multiplication instead of pow calls and minor style changes. 2016-01-31 12:38:18 +01:00
Martin Miller
28b7bd1ec2 Transfer changes for ascii link labeling 2016-01-31 10:23:08 +01:00
Witold Filipczyk
c84dfd7e18 mem_free_if where aplicable. Initialised memory in encoding/* 2015-05-10 17:27:55 +02:00
Witold Filipczyk
ca4d770c0b Revert "Apply styles of html element for body element."
This reverts commit 5f9b54f594.
2015-05-09 22:11:13 +02:00
Witold Filipczyk
46767f6bf0 Introduced the document.browse.show_refresh_link option.
Whether to show Refresh: link line. Default 1.
2015-01-02 14:53:18 +01:00
Fabienne Ducroquet
ad7ff0386d Changes in the handling of the format flags for list elements
* Rename P_STAR as P_DISC and P_PLUS as P_SQUARE.

* Delete P_NONE because it was used only as the default flag in init_html_parser
  and a list with P_NONE then got bullets, so instead use P_DISC by default (as
  per the CSS specification), and P_NO_BULLET for lists with no bullets.

* Use as bullets the characters:
  - U+25E6 WHITE BULLET for the circle style;
  - U+25AA BLACK SMALL SQUARE (alias square bullet) for the square style;
  - U+2022 BULLET for the disc style (default).

Signed-off-by: Fabienne Ducroquet <fabiduc@gmail.com>
2013-09-07 10:51:54 +02:00
Kalle Olavi Niemitalo
87eac68dc3 Fix "parameter has incomplete type" on GCC 3.4.6
Fix this GCC 3.4.6 warning, which becomes an error
if configure --enable-debug adds -Werror to CFLAGS:

      [CC]   src/document/css/apply.o
In file included from /home/Kalle/src/elinks-0.12/src/document/html/internal.h:6,
                 from /home/Kalle/src/elinks-0.12/src/document/css/apply.c:35:
/home/Kalle/src/elinks-0.12/src/document/html/parser.h:149: warning: parameter has incomplete type
In file included from /home/Kalle/src/elinks-0.12/src/document/css/apply.c:35:
/home/Kalle/src/elinks-0.12/src/document/html/internal.h:125: warning: parameter has incomplete type

Even without this warning, "enum html_special_type;"
would not be standard C89.
(cherry picked from elinks-0.12 commit c9f487cdf4)

Conflicts:
	src/document/html/parser.h: 0.13.GIT had more #includes already.
2012-11-03 22:16:23 +02:00
witekfl
88be88c819 Revert "Show the URI in the title bar even if document title is set."
This reverts commit d06cccffd6.

Some people wants URL in the title bar, but some wants the title.
I restored previous version (the title). If you want the URL, create
the patch with a configurable option.
2012-09-02 19:19:02 +02:00
witekfl
4ec188d75e When shifting characters (for example with ALIGN_CENTER) set
colors of the empty area to the color of the first char of the centered
text. Previously it was set to the default background.
2012-07-11 11:17:24 +02:00
witekfl
aead2de59a Do not treat <li> specially and handle </li>. See test/ul_a_li.html. 2012-06-12 14:31:55 +02:00
witekfl
5f9b54f594 Apply styles of html element for body element.
See test/css/css_body.html and test/css/css_html.html
2012-05-22 15:22:48 +02:00
Miciah Dashiel Butler Masters
0189b6bfc9 Add support & test for the CSS list-style property
Recognise the list-style property and apply it by setting the
appropriate flag on the element's parattr based on the property's value.

Add test/list-style.html with an example of each possible list-style
value (many are unsupported by the HTML engine).
2011-11-14 04:34:50 +00:00
witekfl
d06cccffd6 Show the URI in the title bar even if document title is set.
ECMAcript's window.title overrides this.
2011-10-18 20:57:32 +02:00
Kalle Olavi Niemitalo
e22eae2e93 HTML: Rewrite parsing of meta refresh
The URL in <meta http-equiv="Refresh" content="42; URL=target.html">
can now freely contain spaces and semicolons.  There cannot be other
parameters between the delay and the URL.  If the URL is not quoted,
then it spans to the end of the attribute, except not to trailing
spaces.  If the URL is quoted, then it ends at the first closing
quotation mark.  All this is consistent with Debian Iceweasel 3.5.16.
2011-05-01 22:59:23 +03:00
Kalle Olavi Niemitalo
715571a5d6 HTML bug 1114: Don't doubly decode entities in attributes
The HTML parser decoded SGML entity references and numeric character
references in the following attributes, and then the renderer did the
same again:

link/@title
link/@hreflang
link/@type
link/@media
img/@alt
area/@alt
input[@type="image"]/@alt
input[@type="image"]/@name
input[@type="button"]/@value

The result was that e.g. title="&amp;#65;" displayed as "A"
even though it was supposed to display as "&#65;".

Fix by making the HTML parser tell the renderer that the entities have
already been decoded.
2011-05-01 22:54:45 +03:00
Witold Filipczyk
cbf70d5304 Refactoring: use struct string instead of unsigned char.
It probably doesn't make sense, but there is one warning less on OpenBSD.
2010-09-19 13:56:54 +02:00
Witold Filipczyk
d112adc8f3 include libgen.h for basename 2010-09-19 13:01:42 +02:00
Witold Filipczyk
79340fa4ac Better looking symbols for LI elements. 2010-08-11 21:22:21 +02:00
Nils Dagsson Moskopp
2f0d954add Rudimentary support for HTML5 media elements
Make use of the HTML5 media elements, <video> and <audio> by adding
links to the media.
2010-08-07 20:44:44 +00:00
Witold Filipczyk
d91668b0c5 Pass the codepage (cp) instead of options to the scan_http_equiv. 2009-01-27 09:23:56 +01:00
Kalle Olavi Niemitalo
687f19dbde Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/bfu/dialog.c
	src/bfu/hotkey.c
	src/bfu/inpfield.c
	src/dialogs/options.c
	src/document/renderer.c
	src/intl/gettext/libintl.h
	src/protocol/http/codes.c
	src/session/task.c
	src/terminal/event.c
	src/terminal/terminal.h
	src/viewer/text/form.c
	src/viewer/text/link.c

And a semantic conflict in src/terminal/terminal.c.
2009-01-01 19:14:01 +00:00
Kalle Olavi Niemitalo
25da8085b3 Fix double-free crash if EOF immediately follows </MAP>.
look_for_link() used to return 0 both when it found the closing </MAP>
tag, and when it hit the end of the file.  In the first case, it also
added *menu to the memory_list; in the second case, it did not.  The
caller get_image_map() supposedly distinguished between these cases by
checking whether pos >= eof, and freed *menu separately if so.

However, if the </MAP> was at the very end of the HTML file, so that
not even a newline followed it, then look_for_link() left pos == eof
even though it had found the </MAP> and added *menu to the memory_list.
This made get_image_map() misinterpret the result and mem_free(*menu)
even though *menu had already been freed as part of the memory_list;
thus the crash.

To fix this, make look_for_link() return -1 instead of 0 if it hits
EOF without finding the </MAP>.  Then make get_image_map() check the
return value instead of comparing pos to eof.  And add a test case,
although not an automated one.

Alternatively, look_for_link() could have been changed to decrement
pos between finding the </MAP> and returning 0.  Then, the pos >= eof
comparison in get_image_map() would have been false.  That scheme
would however have been a bit more difficult to understand and
maintain, I think.

Reported by Paul B. Mahol.
(cherry picked from commit a2404407ce)
2008-12-31 20:15:44 +00:00
Kalle Olavi Niemitalo
0ec4f380fa Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	AUTHORS
2008-11-10 00:07:20 +02:00
Peter Collingbourne
658b9cc70f Fixed bug relating to newlines in hidden input fields
This patch fixes an issue whereby a newline character appearing within
a hidden input field is incorrectly reinterpreted as a space character.
The patch handles almost all cases, and includes a test case.
15/18 tests pass, but the remainder currently fail due to the fact
that ELinks does not currently support textarea scripting.
2008-11-09 23:28:46 +02:00
Kalle Olavi Niemitalo
5c2fada371 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:
	src/session/download.c
2008-11-01 22:39:17 +02:00
M. Vefa Bicakci
20a7a6c460 Patch 3: Further fixes including strcasestr and convert_to_lowercase 2008-11-01 22:32:43 +02:00
M. Vefa Bicakci
96b3093519 Patch 2: Modifications to the remaining parts of ELinks
[Forward ported to 0.12 from bug 1004 attachment 499.  --KON]
2008-11-01 22:20:25 +02:00
M. Vefa Bicakci
86085de07e Patch 1: Finalize modifications to the HTML parser
[Forward ported to 0.12 from bug 1004 attachment 498.  --KON]
2008-10-26 18:00:19 +02:00
M. Vefa Bicakci
85c26ddc45 Patch 0: Partial modification of the HTML parser and modification of the FastFind subsystem
[Forward ported to 0.12 from bug 1004 attachment 500.  --KON]
2008-10-26 16:13:38 +02:00
Kalle Olavi Niemitalo
0f6add14f2 Update document.comb_x and comb_y when splitting lines.
On 2008-09-05, it was reported to elinks-dev that ELinks hits an
internal error (bad alloc_header) when given a specific HTML file.
On 2008-09-09, out-of-range values of document->comb_x and
document->comb_y were noted as the cause of memory corruption.
Update those variables when splitting, aligning, or justifying a line.
Add many assertions to detect the bug if it occurs again.
2008-09-14 17:29:39 +03:00
Kalle Olavi Niemitalo
8548108e39 Make document.comb_{x,y} not relative to part.box.
Previously, the character at (document.comb_x, document.comb_y) was
accessed via the POS macro, which adds part.box.x and part.box.y to
the coordinates.  However, if document.comb and document.y are set
at the end of one part and read at the beginning of another, then
the struct screen_char used by the original part should be updated,
even though the new part has a different box.  Change comb_{x,y} to
be relative to the document, rather than to the box of a single part.
2008-09-14 16:15:25 +03:00
Kalle Olavi Niemitalo
83ccaa3673 Bug 698: Keep forms contiguous and non-overlapping and start from 0.
In document.forms, each struct form has form_num and form_end members
that reserve a subrange of [0, INT_MAX] to that form.  Previously,
multiple forms in the list could have form_end == INT_MAX and thus
overlap each other.  Prevent that by adjusting form_end of each form
newly added to the list.

Revert 438f039bda,
"check_html_form_hierarchy: Old code was buggy.", which made
check_html_form_hierarchy attach controls to the wrong forms.
Instead, construct the dummy form ("for those Flying Dutchmans") at
form_num == 0 always before adding any real forms to the list.
This prevents the assertion failure by ensuring that every possible
form_control.position is covered by some form, if there are any forms.

Add a function assert_forms_list_ok, which checks that the set of
forms actually covers the [0, INT_MAX] range without overlapping,
as intended.  Call that from check_html_form_hierarchy to detect
any corruption.

I have tested this code (before any cherry-picking) with:
- bug 613 attachment 210: didn't crash
- bug 714 attachment 471: didn't crash
- bug 961 attachment 382: didn't crash
- bug 698 attachment 239: all the submit buttons showed the right URLs
- bug 698 attachment 470: the submit button showed the right URL

(cherry picked from commit 386a5d517b)
2008-07-20 11:46:01 +03:00
Kalle Olavi Niemitalo
386a5d517b Bug 698: Keep forms contiguous and non-overlapping and start from 0.
In document.forms, each struct form has form_num and form_end members
that reserve a subrange of [0, INT_MAX] to that form.  Previously,
multiple forms in the list could have form_end == INT_MAX and thus
overlap each other.  Prevent that by adjusting form_end of each form
newly added to the list.

Revert 438f039bda,
"check_html_form_hierarchy: Old code was buggy.", which made
check_html_form_hierarchy attach controls to the wrong forms.
Instead, construct the dummy form ("for those Flying Dutchmans") at
form_num == 0 always before adding any real forms to the list.
This prevents the assertion failure by ensuring that every possible
form_control.position is covered by some form, if there are any forms.

Add a function assert_forms_list_ok, which checks that the set of
forms actually covers the [0, INT_MAX] range without overlapping,
as intended.  Call that from check_html_form_hierarchy to detect
any corruption.

I have tested this code (before any cherry-picking) with:
- bug 613 attachment 210: didn't crash
- bug 714 attachment 471: didn't crash
- bug 961 attachment 382: didn't crash
- bug 698 attachment 239: all the submit buttons showed the right URLs
- bug 698 attachment 470: the submit button showed the right URL
2008-07-14 15:02:06 +03:00
Miciah Dashiel Butler Masters
c21a3592c9 Build fix: Wrap supports_html_media_attr with #ifdef CONFIG_CSS/#endif 2008-06-18 08:48:18 +00:00
Miciah Dashiel Butler Masters
9af30f13b9 Document start_element and end_element 2008-06-09 13:58:41 +00:00
Miciah Dashiel Butler Masters
3c44a88b39 Document the invisible and name members of struct html_element 2008-06-09 13:58:41 +00:00
Miciah Dashiel Butler Masters
3a0286e447 Strings corrections from Malcolm Parsons
Fix the spelling and grammar in various comments, variable names, comment
descriptions, and documentation.
2008-01-27 04:19:23 +00:00
Miciah Dashiel Butler Masters
643a34e6af Strings corrections from Malcolm Parsons
Fix the spelling and grammar in various comments, variable names, comment
descriptions, and documentation.
2008-01-27 04:09:18 +00:00
Kalle Olavi Niemitalo
4138b401ca Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	src/document/css/stylesheet.c
	src/document/css/stylesheet.h
2008-01-26 18:15:33 +02:00
Kalle Olavi Niemitalo
cab0b3fbd5 const in CSS 2008-01-26 18:10:13 +02:00
Kalle Olavi Niemitalo
f19c948ca7 Bug 824: Disable combining characters unless --enable-combining.
Label this as an experimental feature because it has so many bugs
and it is not clear how they can be fixed.
2008-01-19 20:58:22 +02:00
Kalle Olavi Niemitalo
14d1a0f3e2 Bug 824: Define _XOPEN_SOURCE, not __USE_XOPEN.
_XOPEN_SOURCE has been standardized in SUSv2.  <features.h> of GNU
libc then defines the internal __USE_XOPEN macro.
2008-01-19 20:52:05 +02:00
Kalle Olavi Niemitalo
2fd3e0b3b3 combined: Leave the screen_char attributes unchanged.
The previous code displayed the wrong attributes if the combining
characters were at the end of an HTML link.  For example:

  <a href="#">trickỹ</a> more text <a href="#">second link</a>

  (The characters in the first A element are "tricky" and U+0303
  COMBINING TILDE.)

Here, when the cursor was not at the first link, ELinks displayed
the y-with-tilde cell as if it were not part of the link.
This happened because ELinks had already changed schar->attr
before set_line saw the space character after the link and
flushed document->combi[].
2008-01-19 20:50:10 +02:00
Witold Filipczyk
83a4d815ae combined: Added combining characters support.
Combining characters requires a UTF-8 locale.
It slows down rendering. There is still the unresolved issue with
combining characters at the end of a document.
This patch wasn't heavilly tested. Especially a "garbage" input may cause
unpredictable results.
2008-01-19 20:49:57 +02:00
Kalle Olavi Niemitalo
d2733656b8 Bug 722: Truncate names of HTML media types.
HTML 4.01 section 6.13 says each entry in the list
must be truncated before the first character that
is not in the allowed set.
2008-01-12 10:08:02 +02:00
Kalle Olavi Niemitalo
65b365587e Bug 722: Read document.css.media only if needed. 2008-01-12 09:37:56 +02:00
Kalle Olavi Niemitalo
0c899dcc8a Bug 722: Default to media="all", not media="screen". 2008-01-12 09:35:41 +02:00
Kalle Olavi Niemitalo
60144e9ff6 Bug 722: Filter CSS according to media types.
This patch adds support for:
- option document.css.media
- CSS @import "foo.css" tty;
- CSS @media tty { ... }
- HTML <link rel="stylesheet" media="tty">
- HTML <style media="tty">

This patch is attachments 395 and 396 from bugzilla.elinks.cz, which
are based on attachment 388 from bugzilla.elinks.cz.  This new
version of the patch fixes conflicts with recent 0.13.GIT changes,
marks Doxygen commands with at-signs rather than backslashes, and
adds a few comments.
2007-12-22 03:18:06 +00:00
Laurent MONIN
a35a5c557a Use @cp to shorten the line. 2007-10-15 12:32:25 +02:00
Laurent MONIN
b1eaca1f1e Drop unused variable @options from html_focusable(). 2007-10-15 12:31:16 +02:00
Laurent MONIN
31d8ffc578 In extract_color() and get_color(), make names of variables more explicit.
c -> attribute
r -> retval
at -> value
2007-10-15 12:26:19 +02:00
Laurent MONIN
a1125df95f Make get_bgcolor() use extract_color() instead of get_color().
It prevents a useless test, use_document_fg_colors() is
always true when use_document_bg_colors() is true.
2007-10-15 12:19:46 +02:00
Laurent MONIN
b709061864 Move code from get_color() to new extract_color(). 2007-10-15 12:17:08 +02:00
Laurent MONIN
11dea66ff1 struct table bordercolor,bgcolor -> color.(border|background) 2007-10-12 17:10:30 +02:00
Laurent MONIN
367767c500 struct par_attrib bgcolor -> color.background 2007-10-12 17:04:44 +02:00
Laurent MONIN
f150f22ac9 Use color.background instead of bgcolor in struct document too.
Not useful but coherent with other changes.
2007-10-12 16:50:47 +02:00
Laurent MONIN
bc498c00da struct text_style_color fg,bg -> foreground, background 2007-10-12 16:41:06 +02:00
Laurent MONIN
f8cdb5d472 More anonymous structures were named. 2007-10-12 16:24:41 +02:00
Laurent MONIN
24605c967e Mark colors in struct document_options by using a new struct for them.
default_(link|vlink|...) -> default_color.(link|vlink|...)
2007-10-12 12:11:31 +02:00
Laurent MONIN
a5548fadd2 Use (correct) type enum form_mode for struct text_attrib field select_disabled. 2007-10-12 11:00:41 +02:00
Laurent MONIN
192c2a9e12 Use parenthesis around macro parameters.
Macros concerned are:
is_inline_element()
is_block_element()
2007-10-12 10:51:49 +02:00
Laurent MONIN
944a8e7bd9 style.(fg|bg) -> style.color.(fg|bg)
Introduce INIT_TEXT_STYLE() macro to initialize struct text_style.
2007-10-10 14:59:15 +02:00
Laurent MONIN
ca6424595b format.(clink|vlink|...) -> format.color.(clink|vlink|...)
It makes more obvious these fields are colors.
2007-10-10 14:37:10 +02:00
Miciah Dashiel Butler Masters
f2f478eb2f Let CSS selectors select non-pairable elements
This necessitates that non-pairable elements be briefly pushed on the stack, so that get_css_selector_for_element sees them, and then popped.

It would be possible to push them only when CONFIG_CSS is defined, as they are otherwise not needed (as evidenced by the fact that we've gone so long without bothering to push them).  However, the performance hit should be small, the necessary #ifdef/#endif wrappers would be pretty ugly, and ideally, the CSS code will someday be in such a state that it can be considered an integral feature.
2007-10-09 14:14:45 +00:00
Laurent MONIN
05fc8f5169 Fix compilation with --disable-css.
Compilation failed due to missing DEBUG_CSS test.
This was introduced in commit 98260f7970
2007-09-24 15:32:42 +02:00
Laurent MONIN
27057926b9 Fix compilation with --disable-css.
Compilation failed due to missing DEBUG_CSS test.
This was introduced in commit 98260f7970
2007-09-21 11:05:40 +02:00
Laurent MONIN
fec10a1846 Revert "format_html_part(): save and restore renderer_context.last_tag_for_newline too."
This reverts commit 60913ba9f9.
This was a bad move, anchors ceased to function correctly.
Reported by Witekfl.
2007-09-19 09:22:44 +02:00
Laurent MONIN
39d9f669c9 Revert "format_html_part(): save and restore renderer_context.last_tag_for_newline too."
This reverts commit 4abce8e363.
This was a bad move, anchors ceased to function correctly.
Reported by Witekfl.
2007-09-19 09:14:53 +02:00
Jonas Fonseca
8e3c2d6042 Move find_tag to document/document 2007-09-14 16:29:13 +02:00
Laurent MONIN
f0e66866f5 Trim trailing whitespaces. 2007-09-14 15:12:32 +02:00
Jonas Fonseca
890903a65d Compile fix for commit e876df70d8 2007-09-14 15:08:51 +02:00
Petr Baudis
c1b91c7bf3 document/html: Make HTML parser state transparent
Before, *_html_parser_state() operated with struct html_element *. Now, it is
transparent for the renderer (just void *), so that DOM won't have to provide
this struct but will be able to use something internal.

Backported from master.
2007-09-14 15:06:56 +02:00
Petr Baudis
37b20d998c document/html: Move enum html_special_type from parser.h to renderer.h
...since it is renderer interface.
2007-09-14 15:03:14 +02:00
Laurent MONIN
09cf904814 Backport Pasky's changes concerning text_style-related stuff.
It partially includes changes made in following commits:

document/html: struct text_attrib_style -> struct text_style
commit    e133941206

document: struct format_attr -> struct text_style_format
commit    070d335796

document: Unify text style -> screen attribute handling
commit    b66d2bec67

document: Move text_style-related stuff to dedicated format.*
commit    db9431465f
2007-09-14 14:59:37 +02:00
Laurent MONIN
d6bb586a00 format_html_part(): group int variables declarations 2007-09-14 10:11:44 +02:00
Laurent MONIN
60913ba9f9 format_html_part(): save and restore renderer_context.last_tag_for_newline too. 2007-09-14 10:10:37 +02:00
Laurent MONIN
e914ca85fe Use explicit names for variables in format_html_part().
llm -> saved_last_link_to_move
ltm -> saved_last_tag_to_move
ef  -> saved_empty_format
lm  -> saved_margin
2007-09-14 10:10:09 +02:00
Laurent MONIN
419cd4775e format_html_part(): group int variables declarations 2007-09-14 10:07:32 +02:00
Laurent MONIN
4abce8e363 format_html_part(): save and restore renderer_context.last_tag_for_newline too. 2007-09-14 09:59:34 +02:00
Laurent MONIN
a6f3323a4b Use explicit names for variables in format_html_part().
llm -> saved_last_link_to_move
ltm -> saved_last_tag_to_move
ef  -> saved_empty_format
lm  -> saved_margin
2007-09-14 09:55:43 +02:00
Laurent MONIN
75d47ef957 Drop useless goto/label. 2007-09-14 09:41:51 +02:00
Laurent MONIN
73b1f43468 Drop useless goto/label. 2007-09-14 09:26:39 +02:00
Laurent MONIN
6e89b39ed0 Fix get_opt_bool() call and finish backport of process_head() split. 2007-09-12 23:51:43 +02:00
Miciah Dashiel Butler Masters
bd0a6f6f7d Reflow check_head_for_cache_control 2007-09-12 23:41:37 +02:00
Miciah Dashiel Butler Masters
deb74bd1bd Factor check_head_for_cache_control out of process_head 2007-09-12 23:41:17 +02:00
Miciah Dashiel Butler Masters
4b297a5b03 Factor check_head_for_refresh out of process_head 2007-09-12 23:38:41 +02:00
Miciah Dashiel Butler Masters
23262b3145 Fix process_head to check for cache-control information even if no refresh
Previously, process_head immediately returned if there was no refresh, never giving the cache-control check further down a chance to run.

Also add new tests:

   nocache.html
   refresh+nocache.html
2007-09-12 23:33:40 +02:00
Laurent MONIN
5b28e89026 Extend Use of LWS() macro to parse_old_meta_refresh(). 2007-09-11 17:57:19 +02:00
Laurent MONIN
41ece7a758 Make meta refresh content attribute parsing more tolerant.
Simply search for 'url' marker ignoring anything
before it.
ELinks is now able to follow incorrectly written
meta refresh content attribute with missing ; before
url= parameter.
As an example, try http://akkada.tivi.net.pl/
2007-09-11 17:55:10 +02:00
Laurent MONIN
d650a434b2 Extend Use of LWS() macro to parse_old_meta_refresh(). 2007-09-11 09:30:26 +02:00
Laurent MONIN
4a6a6909ea Make meta refresh content attribute parsing more tolerant.
Simply search for 'url' marker ignoring anything
before it.
ELinks is now able to follow incorrectly written
meta refresh content attribute with missing ; before
url= parameter.
As an example, try http://akkada.tivi.net.pl/
2007-09-08 21:03:22 +02:00
Miciah Dashiel Butler Masters
a8f28f21c9 Reflow check_head_for_cache_control 2007-09-04 12:13:20 +00:00
Miciah Dashiel Butler Masters
2a2aad15f9 Factor check_head_for_cache_control out of process_head 2007-09-04 12:11:37 +00:00
Miciah Dashiel Butler Masters
fc12376bf5 Factor check_head_for_refresh out of process_head 2007-09-04 12:09:19 +00:00
Miciah Dashiel Butler Masters
2d0180d1e7 Fix process_head to check for cache-control information even if no refresh
Previously, process_head immediately returned if there was no refresh, never giving the cache-control check further down a chance to run.

Also add new tests:

   nocache.html
   refresh+nocache.html
2007-09-04 12:08:08 +00:00
Jonas Fonseca
5d34b4bff6 Move find_tag to document/document 2007-08-31 15:43:54 +02:00
Miciah Dashiel Butler Masters
0e0bacf0d3 Merge branch 'master' of ssh://pasky.or.cz/srv/git/elinks
Conflicts:

	src/document/options.c
2007-08-30 21:13:43 +00:00
Jonas Fonseca
19f3fd686c Compile fix for commit e876df70d8 2007-08-29 20:51:43 +02:00
Petr Baudis
e876df70d8 document/html: Make HTML parser state transparent
Before, *_html_parser_state() operated with struct html_element *. Now, it is
transparent for the renderer (just void *), so that DOM won't have to provide
this struct but will be able to use something internal.
2007-08-28 23:35:00 +02:00
Petr Baudis
e5539a9937 document/html: Move enum html_special_type from parser.h to renderer.h
...since it is renderer interface.
2007-08-28 22:19:33 +02:00
Petr Baudis
55495ab655 document: Turn options' default_fg, default_bg to default_style
...as struct text_style. This way it might be possible later to
add other default formatting attributes by CSS and it allows
quite a code simplification in the DOM renderer.
2007-08-28 21:16:44 +02:00
Petr Baudis
db9431465f document: Move text_style-related stuff to dedicated format.*
We will need to include it from options.h and the include chain just
wouldn't work. And it feels like a hack to have it in renderer.h anyway.
2007-08-28 21:05:00 +02:00
Petr Baudis
b66d2bec67 document: Unify text style -> screen attribute handling
Currently, all DOM, HTML and plain renderers had their own routine for
conversion from text style to screen attribute. This moves text_style and
text_style_format from html/parser.h to renderer.h and introduces new generic
routine get_screen_chracter_template() that is used by all the specific
rendering engines.
2007-08-28 21:02:08 +02:00
Petr Baudis
070d335796 document: struct format_attr -> struct text_style_format 2007-08-28 20:17:53 +02:00
Petr Baudis
e133941206 document/html: struct text_attrib_style -> struct text_style 2007-08-28 20:15:30 +02:00
Miciah Dashiel Butler Masters
ea372bd0cd get_opt_*: Add ses parameter
Add a session parameter to get_opt_ and its wrappers in preparation for session-specific and domain-specific options.
2007-08-28 17:24:59 +00:00
Miciah Dashiel Butler Masters
3975d28bce Merge commit 'origin/elinks-0.12'
Conflicts:

	doc/Doxyfile.in
	src/protocol/bittorrent/common.h
2007-08-28 14:47:39 +00:00
Miciah Dashiel Butler Masters
80259bc53e Revert "justify_line(): Re-add wordlen == 0 test"
This reverts commit 18cdce6c39.

elinks-0.12 has a different fix, and I will soon merge in that branch.
2007-08-28 13:41:14 +00:00
Petr Baudis
18cdce6c39 justify_line(): Re-add wordlen == 0 test
This fixes ELinks crashing on this with terminal width e.g. 103:

	<p align="justify">
	xxxx xxxx xxxx xxxxx xxxxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx
	xxxxx xxxx xxxxxxx xxx xxxxxxx xxx xxxx xxxx xxxx xx xxxx x xxx xxxx
	xxxx xx xxxx xxxx xxxx xxx&mdash;xxx xxxx xx&mdash;xxx xxxx<em> </em>x
	xxxx </p>

This test was removed for an unknown reason in commit
b1cc717789.

Discovered together with Miciah.
2007-08-26 19:06:26 +02:00
Kalle Olavi Niemitalo
0cb047b298 Bug 968: Don't use copy_chars in justify_line.
All the needed memory has been allocated before the loop so we can use
copy_screen_chars() directly.  This avoids the assertion failure in
copy_chars() for width==0 and should be a bit faster too.  According
to ISO/IEC 9899:1999 7.21.1p2, memcpy() doesn't copy anything if n==0
(but the pointers must be valid).
(original 'git cherry-pick' arguments: cherry-pick bug968-att394)
2007-07-30 16:43:46 +03:00
Kalle Olavi Niemitalo
2437d35904 Merge commit 'pasky.or.cz/elinks-0.12' into elinks-0.13
There were conflicts in src/document/css/ because 0.12.GIT switched
to LIST_OF(struct css_selector) and 0.13.GIT switched to struct
css_selector_set.  Resolved by using LIST_OF(struct css_selector)
inside struct css_selector_set.
2007-07-28 03:22:29 +03:00
Kalle Olavi Niemitalo
96176a8c77 Declare element types of lists. 2007-07-26 22:47:23 +03:00
Kalle Olavi Niemitalo
ab9e0821d6 Merge commit 'pasky.or.cz/elinks-0.12' into elinks-0.13 2007-07-22 18:48:45 +03:00
Kalle Olavi Niemitalo
b1cc717789 Preserve underlines in links when justifying. 2007-07-20 17:57:01 +03:00
Kalle Olavi Niemitalo
ace03d5093 CSS: new struct css_selector_set 2007-07-16 00:28:49 +03:00
Kalle Olavi Niemitalo
8097929290 Merge with #elinks-0.12 2007-07-16 00:18:17 +03:00
Kalle Olavi Niemitalo
98260f7970 CSS bug 766: Parse the id and class attributes in advance.
time elinks -no-connect -no-home 'http://rss.slashdot.org/Slashdot/slashdot/to?m=5878'
Wait until finished loading, then press q and Enter.

before	19.96user 0.16system 0:25.97elapsed 77%CPU (0avgtext+0avgdata 0maxresident)k
	0inputs+0outputs (0major+3630minor)pagefaults 0swaps
after	6.46user 0.12system 0:12.66elapsed 52%CPU (0avgtext+0avgdata 0maxresident)k
	0inputs+0outputs (0major+3630minor)pagefaults 0swaps
before	18.02user 0.19system 0:23.86elapsed 76%CPU (0avgtext+0avgdata 0maxresident)k
	0inputs+0outputs (0major+3572minor)pagefaults 0swaps
after	5.73user 0.15system 0:10.02elapsed 58%CPU (0avgtext+0avgdata 0maxresident)k
	0inputs+0outputs (0major+3628minor)pagefaults 0swaps
before	19.80user 0.15system 0:25.14elapsed 79%CPU (0avgtext+0avgdata 0maxresident)k
	0inputs+0outputs (0major+3461minor)pagefaults 0swaps
after	6.28user 0.13system 0:11.91elapsed 53%CPU (0avgtext+0avgdata 0maxresident)k
	0inputs+0outputs (0major+3626minor)pagefaults 0swaps
2007-07-15 22:19:30 +03:00
Witold Filipczyk
438f039bda check_html_form_hierarchy: Old code was buggy.
Old code caused the assertion failure on the shutdownday's page.
2007-07-10 15:22:47 +03:00
Kalle Olavi Niemitalo
eccc8c23f0 Merge with http://elinks.cz/elinks.git#elinks-0.12 2007-07-09 16:03:06 +03:00
Kalle Olavi Niemitalo
c2ca46cb81 Bug 461: Ensure contrast when filling with spaces.
So that the cursor will be visible in the Linux console.
2007-05-20 19:23:33 +03:00
Kalle Olavi Niemitalo
f8f99cc04e put_link_line: Add a comment related to bug 213. 2007-05-13 12:11:17 +03:00
Kalle Olavi Niemitalo
68ff5a8d61 Bug 816, html_textarea: Expand entity references.
Because the renderer no longer does that.
The comment "We don't cope well with entities here" may now be
obsolete but I'm not sure about that so I'm leaving it in.
2007-04-30 02:10:25 +03:00
Kalle Olavi Niemitalo
a58345f4e7 html_textarea: Use memmove rather than memcpy.
This is an overlapping copy and memcpy is not required to support that.
2007-04-30 01:41:32 +03:00
Kalle Olavi Niemitalo
bafe47508d Bug 784: Add html_context->doc_cp and parse attributes with it.
options->cp is still used for this in seven places where html_context
is not easily available.  Those should eventually be corrected too,
but I'm checking this change in already because it's better than what
we had before.
2007-04-30 00:56:39 +03:00
Kalle Olavi Niemitalo
5e83337d49 Bug 784: Keep form_control.default_value in the document charset.
Previously, html_special_form_control converted
form_control.default_value to the terminal charset, and init_form_state
then copied the value to form_state.value.  However, when CONFIG_UTF8
is defined and UTF-8 I/O is enabled, form_state.value is supposed to
be in UTF-8, rather than in the terminal charset.

This mismatch could not be conveniently fixed in
html_special_form_control because that does not know which terminal is
being used and whether UTF-8 I/O is enabled there.  Also, constructing
a conversion table from the document charset to form_state.value could
have ruined renderer_context.convert_table, because src/intl/charsets.c
does not support multiple concurrent conversion tables.

So instead, we now keep form_control.default_value in the document
charset, and convert it in the viewer each time it is needed.  Because
the result of the conversion is kept in form_state.value between
incremental renderings, this shouldn't even slow things down too much.

I am not implementing the proper charset conversions for the DOM
defaultValue property yet, because the current code doesn't have
them for other string properties either, and bug 805 is already open
for that.
2007-04-29 22:01:13 +03:00
Laurent Monin
084d402c51 Bug 816, html_special_form_control: Don't parse character entity references. 2007-04-29 21:25:42 +03:00
Kalle Olavi Niemitalo
ce05aa1f37 Bug 947, set_hline: Also recognize NBSP_CHAR #ifndef CONFIG_UTF8. 2007-04-26 23:46:03 +03:00
Laurent MONIN
0b98c5051b Fix trailing whitespaces 2007-04-26 15:02:04 +02:00
Kalle Olavi Niemitalo
0b7a56f89a Bug 947, set_hline: Respect wrap_nbsp also if !part->document.
This does not yet fix bug 947 for the case where the document is UTF-8
and the terminal is ISO-8859-1.  That will require changing charsets.c
too, it seems.
2007-04-26 07:48:11 +03:00
Kalle Olavi Niemitalo
fa9567653d set_hline: Outdent some code. 2007-04-26 07:38:37 +03:00
Kalle Olavi Niemitalo
0c3a871a4b Bug 879, set_hline: Discard U+00AD SOFT HYPHEN characters if UTF-8.
If not UTF-8, then charsets.c has already discarded them.
2007-04-26 07:12:28 +03:00
Witold Filipczyk
e347122e6d get_attr_value: do not do trim_chars
trim_chars was called only in debug mode and the results of the get_attr_val
for value=" something " in debug mode differ from normal and fastmem mode.

[ From commit c4500039b2 on the witekfl
  branch.  --KON ]
2007-03-18 13:32:25 +02:00
Kalle Olavi Niemitalo
7645a836fc Cast the NULL argument of straconcat to unsigned char *.
straconcat reads the args with va_arg(ap, const unsigned char *),
and the NULL macro may have the wrong type (e.g. int).

Many places pass string literals of type char * to straconcat.  This
is in principle also a violation, but I'm ignoring it for now because
if it becomes a problem with some C implementation, then so will the
use of unsigned char * with printf "%s", which is so widespread in
ELinks that I'm not going to try fixing it now.
2007-03-11 12:59:11 +02:00
Kalle Olavi Niemitalo
22af2b22e2 Cast variadic arguments of add_to_ml to void *.
getml reads the args with va_arg(ap, void *), and the NULL macro in
particular may have the wrong type.
2007-03-11 12:44:13 +02:00
Kalle Olavi Niemitalo
801d520ddd Fix compiler errors without HAVE_VARIADIC_MACROS. 2007-03-11 12:22:02 +02:00
Witold Filipczyk
27a66f59d9 Fix the memleak. Part II of the 927 bugfix. 2007-02-25 11:02:53 +02:00
Witold Filipczyk
e01785e462 The fix for the bug 927.
When tables were rendered first time html_format_part was called with
document==NULL. <meta http-equiv=Refresh.../> was inside a table,
so document was NULL. Second time the table knew its dimensions
and document was not NULL.
2007-02-25 11:02:48 +02:00
Kalle Olavi Niemitalo
408d86f2b1 Remove temporary indentation left in the previous commit. 2007-01-30 10:27:57 +02:00
Kalle Olavi Niemitalo
ebf549ba77 Fix document.html.wrap_nbsp in UTF-8 terminals.
!CONFIG_UTF8, ISO-8859-1 doc, ASCII terminal, UTF-8 or unibyte I/O:
  &nbsp; ok, &#160; ok, &#xA0; ok, A0 ok
!CONFIG_UTF8, ISO-8859-1 doc, ISO-8859-1 terminal, UTF-8 or unibyte I/O:
  &nbsp; ok, &#160; ok, &#xA0; ok, A0 ok
!CONFIG_UTF8, UTF-8 doc, ASCII terminal, UTF-8 or unibyte I/O:
  &nbsp; ok, &#160; ok, &#xA0; ok, C2 A0 fail (drawn as "\001").
!CONFIG_UTF8, UTF-8 doc, ISO-8859-1 terminal, UTF-8 or unibyte I/O:
  &nbsp; ok, &#160; ok, &#xA0; ok, C2 A0 fail (not wrapped).
CONFIG_UTF8, ISO-8859-1 doc, ASCII terminal, UTF-8 or unibyte I/O:
  &nbsp; ok, &#160; ok, &#xA0; ok, A0 ok
CONFIG_UTF8, ISO-8859-1 doc, ISO-8859-1 terminal, UTF-8 or unibyte I/O:
  &nbsp; ok, &#160; ok, &#xA0; ok, A0 ok
CONFIG_UTF8, ISO-8859-1 doc, UTF-8 terminal, UTF-8 I/O:
  all fail (not wrapped); after patch all ok.
CONFIG_UTF8, UTF-8 doc, ASCII terminal, UTF-8 or unibyte I/O:
  &nbsp; ok, &#160; ok, &#xA0; ok, C2 A0 fail (drawn as "\001").
CONFIG_UTF8, UTF-8 doc, ISO-8859-1 terminal, UTF-8 or unibyte I/O:
  &nbsp; ok, &#160; ok, &#xA0; ok, C2 A0 fail (not wrapped)
CONFIG_UTF8, UTF-8 doc, UTF-8 terminal, UTF-8 I/O:
  all fail (not wrapped); after patch all ok.
2007-01-30 10:21:12 +02:00
Kalle Olavi Niemitalo
419857dce6 set_hline: Add some comments. 2007-01-29 21:07:13 +02:00
Kalle Olavi Niemitalo
a287f547fd set_hline: Add a FIXME comment about invalid UTF-8. 2006-12-26 14:59:16 +02:00
Kalle Olavi Niemitalo
cd10da6f31 Bug 912, set_hline: Don't let LINE(y).length remain larger than needed. 2006-12-26 14:51:42 +02:00
Kalle Olavi Niemitalo
26cce9aab3 Bug 912, realloc_line: Return the original line->length if successful.
This will let the caller restore the length if it notices it has
allocated too much space.
2006-12-26 14:38:58 +02:00
Kalle Olavi Niemitalo
819653836a Bug 912: Callers of realloc_line treat only values < 0 as errors.
This will let me change realloc_line to return the original length.
2006-12-26 14:37:08 +02:00
Kalle Olavi Niemitalo
6b68d38131 set_hline: Define local variables as const where possible.
I hope this makes the source easier to understand.
2006-12-26 14:27:50 +02:00
Kalle Olavi Niemitalo
f396abcf19 Bug 902: set_hline: Assert that we didn't go past end of array.
This assertion detects the overflow that manifested as bug 902.
2006-12-20 23:19:24 +02:00
Kalle Olavi Niemitalo
47f7ba24c6 Bug 902: set_hline: Allocate memory for one more character cell. 2006-12-20 22:04:41 +02:00
Kalle Olavi Niemitalo
a1fe5cf975 Bug 826, UTF-8 set_hline: Don't skip the character after double-cell.
I do not fully understand this code, but I am sure skipping characters
like this is a bug, and correcting it seems to fix bug 826 (too small
table for double-cell characters).  I don't see any similar bugs in
other parts of set_hline.

The patch is from bug 826, comment 4, attachment 308.  The warning
there about unicode_to_cell(UCS_NO_CHAR) still applies but this patch
does not make the situation worse.  I have logged a separate bug 901
about those calls.
2006-12-17 18:13:28 +02:00
Kalle Olavi Niemitalo
a193632187 Make html_context.quote_level unsigned.
Continuation of 7e9fc6f33b.
2006-12-10 14:14:16 +02:00
Jonas Fonseca
9d43babde2 Fix out-of-bound access to the quote_char buffer
The quote_level was decremented unconditionally and could become negative
resulting in a negative index after applying "modulus 2". Reproducable
with an HTML file contianing "</q>".

Reported by paakku.
2006-11-26 22:32:02 +01:00
Kalle Olavi Niemitalo
c283b128b6 Bug 387: Treat &#013; inside <pre>...</pre> as a newline.
Recognize all of &#13; &#10; &#xA; &#xD; with any number of leading
zeroes.  (Previously only &#13; and &#x0A; were supported.)  All of
these are case insensitive.

Treat each CR+LF combination (&#13;&#10;) as a single newline.
2006-11-11 20:31:25 +02:00
Witold Filipczyk
461787013b Revert commit 7cb91c3213. Doble glyphs should
be displayed correctly.
2006-10-01 16:08:52 +02:00
Kalle Olavi Niemitalo
92cb452a9e Rename CONFIG_UTF_8 to CONFIG_UTF8.
The configure script no longer recognizes "CONFIG_UTF_8=yes" lines
in custom features.conf files.  They will have to be changed to
"CONFIG_UTF8=yes".  This incompatibility was deemed acceptable
because no released version of ELinks supports CONFIG_UTF_8.

The --enable-utf-8 option was not renamed.
2006-09-17 16:12:47 +03:00
Kalle Olavi Niemitalo
e8462980e5 Change "utf_8" to "utf8" in most identifiers.
Suggested by Miciah on #elinks.

What was renamed:
  add_utf_8                      => add_utf8
  cp2utf_8                       => cp2utf8
  encode_utf_8                   => encode_utf8
  get_translation_table_to_utf_8 => get_translation_table_to_utf8
  goto invalid_utf_8_start_byte  => goto invalid_utf8_start_byte
  goto utf_8                     => goto utf8
  goto utf_8_select              => goto utf8_select
  terminal_interlink.utf_8       => terminal_interlink.utf8
  utf_8_to_unicode               => utf8_to_unicode

What was not renamed:
  terminal._template_.utf_8_io option, TERM_OPT_UTF_8_IO
    Compatibility with existing elinks.conf files would require an alias.
  --enable-utf-8
    Because the name of the charset is UTF-8, --enable-utf-8 looks better
    than --enable-utf8.
  CONFIG_UTF_8
    Will be renamed in a later commit.
  Unicode/utf_8.cp, table_utf_8, aliases_utf_8
    Will be renamed in a later commit.
2006-09-17 16:06:22 +03:00
Witold Filipczyk
a5c395cd7a Workaround for segfaults introduced by previous commit.
Why html_context->part->document isn't set ?
2006-08-05 20:17:48 +02:00
Witold Filipczyk
b7409fc5a7 The fix for bug 784. There is a wide area to cleanup and tidy up the code. 2006-08-05 18:32:05 +02:00
Witold Filipczyk
bdc3fcb7e4 I forgot about this one 2006-08-05 18:08:52 +02:00
Witold Filipczyk
049d088e8a The massive attack: the only property of options used by get_attr_val was
cp (codepage). To fix bug 784 html_context->part->document->cp should
be passed to get_attr_val instead of html_context->options->cp.
2006-08-05 18:06:28 +02:00
Miciah Dashiel Butler Masters
948d010088 Drop obsolete, commented-out code in put_chars
Drop some code for superscript and subscript handling that was deleted
in commit 65016cdca4, then added back
with the UTF-8 merge in commit 2a6125e3d0,
and then disabled in commit 1b653b9765.
2006-08-03 06:12:30 +00:00
Laurent MONIN
1136aefb71 Trim trailing whitespaces. 2006-07-27 09:51:10 +02:00
Witold Filipczyk
58b158871c Decode the second char of double glyph. Still problems with a splitted
char
2006-07-23 13:14:38 +02:00
Witold Filipczyk
7cb91c3213 Decode the second char from double glyph. When that char is splitted
by convert_string and that char is the beginning of double glyph too
we have a problem. This is a rare case. Must we care about it?
2006-07-23 13:04:39 +02:00
Witold Filipczyk
a3e0caca57 Return number of really processed chars. In that case 0 2006-07-23 12:27:20 +02:00
Witold Filipczyk
f5351fc0dc Remember fragment of the splitted char and decode it next time. Idea by Jonas.
Not tested at all. UCS_NO_CHAR is returned only for <hr> or for UTF-8 char
which is splitted by convert_string
2006-07-21 22:10:18 +02:00
Witold Filipczyk
1b653b9765 Compilation fix 2006-07-21 13:21:21 +02:00
Witold Filipczyk
2a6125e3d0 Merge with utf8. src/document/plain/renderer.c replaced by utf8 version 2006-07-21 13:12:06 +02:00
Witold Filipczyk
8a1ef2ada9 That was missing, at least I think so 2006-07-20 02:05:56 +02:00