libpurple/purplemarkup.h

changeset 42408
94151c4d26b5
parent 42393
408884ab47a9
child 42594
eddde70cedd8
equal deleted inserted replaced
42407:a659e18d8adf 42408:94151c4d26b5
38 * @html: The HTML markup. 38 * @html: The HTML markup.
39 * @dest_xhtml: The destination XHTML output. 39 * @dest_xhtml: The destination XHTML output.
40 * @dest_plain: The destination plain-text output. 40 * @dest_plain: The destination plain-text output.
41 * 41 *
42 * Converts HTML markup to XHTML. 42 * Converts HTML markup to XHTML.
43 *
44 * Since: 2.0.0
43 */ 45 */
46 PURPLE_AVAILABLE_IN_ALL
44 void purple_markup_html_to_xhtml(const char *html, char **dest_xhtml, 47 void purple_markup_html_to_xhtml(const char *html, char **dest_xhtml,
45 char **dest_plain); 48 char **dest_plain);
46 49
47 /** 50 /**
48 * purple_markup_strip_html: 51 * purple_markup_strip_html:
50 * 53 *
51 * Strips HTML tags from a string. 54 * Strips HTML tags from a string.
52 * 55 *
53 * Returns: The new string without HTML. You must g_free this string 56 * Returns: The new string without HTML. You must g_free this string
54 * when finished with it. 57 * when finished with it.
58 *
59 * Since: 2.0.0
55 */ 60 */
61 PURPLE_AVAILABLE_IN_ALL
56 char *purple_markup_strip_html(const char *str); 62 char *purple_markup_strip_html(const char *str);
57 63
58 /** 64 /**
59 * purple_markup_linkify: 65 * purple_markup_linkify:
60 * @str: The string to linkify. 66 * @str: The string to linkify.
62 * Adds the necessary HTML code to turn URIs into HTML links in a string. 68 * Adds the necessary HTML code to turn URIs into HTML links in a string.
63 * 69 *
64 * Returns: The new string with all URIs surrounded in standard 70 * Returns: The new string with all URIs surrounded in standard
65 * HTML <a href="whatever"></a> tags. You must g_free() 71 * HTML <a href="whatever"></a> tags. You must g_free()
66 * this string when finished with it. 72 * this string when finished with it.
73 *
74 * Since: 2.0.0
67 */ 75 */
76 PURPLE_AVAILABLE_IN_ALL
68 char *purple_markup_linkify(const char *str); 77 char *purple_markup_linkify(const char *str);
69 78
70 /** 79 /**
71 * purple_unescape_text: 80 * purple_unescape_text:
72 * @text: The string in which to unescape any HTML entities 81 * @text: The string in which to unescape any HTML entities
100 * 109 *
101 * See purple_unescape_text() 110 * See purple_unescape_text()
102 * 111 *
103 * Returns: The text with HTML entities literalized. You must g_free 112 * Returns: The text with HTML entities literalized. You must g_free
104 * this string when finished with it. 113 * this string when finished with it.
114 *
115 * Since: 2.0.0
105 */ 116 */
117 PURPLE_AVAILABLE_IN_ALL
106 char *purple_unescape_html(const char *html); 118 char *purple_unescape_html(const char *html);
107 119
108 /** 120 /**
109 * purple_markup_slice: 121 * purple_markup_slice:
110 * @str: The input NUL terminated, HTML, UTF-8 (or ASCII) string. 122 * @str: The input NUL terminated, HTML, UTF-8 (or ASCII) string.
123 * this function may be sensitive to changes in GtkIMHtml and may break 135 * this function may be sensitive to changes in GtkIMHtml and may break
124 * when used with other UI's. libpurple users are encouraged to report and 136 * when used with other UI's. libpurple users are encouraged to report and
125 * work out any problems encountered. 137 * work out any problems encountered.
126 * 138 *
127 * Returns: The HTML slice of string, with all formatting retained. 139 * Returns: The HTML slice of string, with all formatting retained.
140 *
141 * Since: 2.0.0
128 */ 142 */
143 PURPLE_AVAILABLE_IN_ALL
129 char *purple_markup_slice(const char *str, guint x, guint y); 144 char *purple_markup_slice(const char *str, guint x, guint y);
130 145
131 /** 146 /**
132 * purple_markup_get_tag_name: 147 * purple_markup_get_tag_name:
133 * @tag: The string starting a HTML tag. 148 * @tag: The string starting a HTML tag.
136 * located at "tag". Tag is expected to point to a '<', and contain 151 * located at "tag". Tag is expected to point to a '<', and contain
137 * a '>' sometime after that. If there is no '>' and the string is 152 * a '>' sometime after that. If there is no '>' and the string is
138 * not NUL terminated, this function can be expected to segfault. 153 * not NUL terminated, this function can be expected to segfault.
139 * 154 *
140 * Returns: A string containing the name of the tag. 155 * Returns: A string containing the name of the tag.
156 *
157 * Since: 2.0.0
141 */ 158 */
159 PURPLE_AVAILABLE_IN_ALL
142 char *purple_markup_get_tag_name(const char *tag); 160 char *purple_markup_get_tag_name(const char *tag);
143 161
144 /** 162 /**
145 * purple_markup_unescape_entity: 163 * purple_markup_unescape_entity:
146 * @text: A string containing an HTML entity. 164 * @text: A string containing an HTML entity.
155 * Note that this function, unlike purple_unescape_html(), does not search 173 * Note that this function, unlike purple_unescape_html(), does not search
156 * the string for the entity, does not replace the entity, and does not 174 * the string for the entity, does not replace the entity, and does not
157 * return a newly allocated string. 175 * return a newly allocated string.
158 * 176 *
159 * Returns: A constant string containing the character representation of the given entity. 177 * Returns: A constant string containing the character representation of the given entity.
178 *
179 * Since: 2.0.0
160 */ 180 */
181 PURPLE_AVAILABLE_IN_ALL
161 const char * purple_markup_unescape_entity(const char *text, int *length); 182 const char * purple_markup_unescape_entity(const char *text, int *length);
162 183
163 G_END_DECLS 184 G_END_DECLS
164 185
165 #endif /* PURPLE_MARKUP_H */ 186 #endif /* PURPLE_MARKUP_H */

mercurial