space_in_image.pl 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. use vars qw(%result_texis %result_texts %result_trees %result_errors
  2. %result_indices %result_sectioning %result_nodes %result_menus
  3. %result_floats %result_converted %result_converted_errors
  4. %result_elements %result_directions_text);
  5. use utf8;
  6. $result_trees{'space_in_image'} = {
  7. 'contents' => [
  8. {
  9. 'args' => [
  10. {
  11. 'contents' => [
  12. {
  13. 'parent' => {},
  14. 'text' => ' ',
  15. 'type' => 'empty_spaces_before_argument'
  16. },
  17. {
  18. 'parent' => {},
  19. 'text' => 'a'
  20. },
  21. {
  22. 'parent' => {},
  23. 'text' => ' ',
  24. 'type' => 'spaces_at_end'
  25. }
  26. ],
  27. 'parent' => {},
  28. 'type' => 'brace_command_arg'
  29. },
  30. {
  31. 'contents' => [
  32. {
  33. 'parent' => {},
  34. 'text' => 'bb'
  35. }
  36. ],
  37. 'parent' => {},
  38. 'type' => 'brace_command_arg'
  39. },
  40. {
  41. 'contents' => [
  42. {
  43. 'parent' => {},
  44. 'text' => ' ',
  45. 'type' => 'empty_spaces_before_argument'
  46. },
  47. {
  48. 'parent' => {},
  49. 'text' => 'cc'
  50. }
  51. ],
  52. 'parent' => {},
  53. 'type' => 'brace_command_arg'
  54. },
  55. {
  56. 'contents' => [
  57. {
  58. 'parent' => {},
  59. 'text' => 'dd'
  60. },
  61. {
  62. 'parent' => {},
  63. 'text' => ' ',
  64. 'type' => 'spaces_at_end'
  65. }
  66. ],
  67. 'parent' => {},
  68. 'type' => 'brace_command_arg'
  69. },
  70. {
  71. 'contents' => [
  72. {
  73. 'parent' => {},
  74. 'text' => 'e'
  75. },
  76. {
  77. 'parent' => {},
  78. 'text' => ' ',
  79. 'type' => 'spaces_at_end'
  80. }
  81. ],
  82. 'parent' => {},
  83. 'type' => 'brace_command_arg'
  84. }
  85. ],
  86. 'cmdname' => 'image',
  87. 'contents' => [],
  88. 'extra' => {
  89. 'brace_command_contents' => [
  90. [
  91. {}
  92. ],
  93. [
  94. {}
  95. ],
  96. [
  97. {}
  98. ],
  99. [
  100. {}
  101. ],
  102. [
  103. {}
  104. ]
  105. ],
  106. 'spaces_before_argument' => {}
  107. },
  108. 'line_nr' => {
  109. 'file_name' => '',
  110. 'line_nr' => 1,
  111. 'macro' => ''
  112. },
  113. 'parent' => {}
  114. },
  115. {
  116. 'contents' => [
  117. {
  118. 'parent' => {},
  119. 'text' => '. '
  120. },
  121. {
  122. 'args' => [
  123. {
  124. 'contents' => [
  125. {
  126. 'parent' => {},
  127. 'text' => ' ',
  128. 'type' => 'empty_spaces_before_argument'
  129. },
  130. {
  131. 'parent' => {},
  132. 'text' => 'f'
  133. },
  134. {
  135. 'parent' => {},
  136. 'text' => ' ',
  137. 'type' => 'spaces_at_end'
  138. }
  139. ],
  140. 'parent' => {},
  141. 'type' => 'brace_command_arg'
  142. }
  143. ],
  144. 'cmdname' => 'image',
  145. 'contents' => [],
  146. 'extra' => {
  147. 'brace_command_contents' => [
  148. [
  149. {}
  150. ]
  151. ],
  152. 'spaces_before_argument' => {}
  153. },
  154. 'line_nr' => {},
  155. 'parent' => {}
  156. },
  157. {
  158. 'parent' => {},
  159. 'text' => '.'
  160. }
  161. ],
  162. 'parent' => {},
  163. 'type' => 'paragraph'
  164. }
  165. ],
  166. 'type' => 'text_root'
  167. };
  168. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[0];
  169. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[0]{'contents'}[1]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[0];
  170. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[0]{'contents'}[2]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[0];
  171. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[0]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0];
  172. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[1]{'contents'}[0]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[1];
  173. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[1]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0];
  174. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[2]{'contents'}[0]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[2];
  175. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[2]{'contents'}[1]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[2];
  176. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[2]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0];
  177. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[3]{'contents'}[0]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[3];
  178. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[3]{'contents'}[1]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[3];
  179. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[3]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0];
  180. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[4]{'contents'}[0]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[4];
  181. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[4]{'contents'}[1]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[4];
  182. $result_trees{'space_in_image'}{'contents'}[0]{'args'}[4]{'parent'} = $result_trees{'space_in_image'}{'contents'}[0];
  183. $result_trees{'space_in_image'}{'contents'}[0]{'extra'}{'brace_command_contents'}[0][0] = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[0]{'contents'}[1];
  184. $result_trees{'space_in_image'}{'contents'}[0]{'extra'}{'brace_command_contents'}[1][0] = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[1]{'contents'}[0];
  185. $result_trees{'space_in_image'}{'contents'}[0]{'extra'}{'brace_command_contents'}[2][0] = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[2]{'contents'}[1];
  186. $result_trees{'space_in_image'}{'contents'}[0]{'extra'}{'brace_command_contents'}[3][0] = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[3]{'contents'}[0];
  187. $result_trees{'space_in_image'}{'contents'}[0]{'extra'}{'brace_command_contents'}[4][0] = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[4]{'contents'}[0];
  188. $result_trees{'space_in_image'}{'contents'}[0]{'extra'}{'spaces_before_argument'} = $result_trees{'space_in_image'}{'contents'}[0]{'args'}[0]{'contents'}[0];
  189. $result_trees{'space_in_image'}{'contents'}[0]{'parent'} = $result_trees{'space_in_image'};
  190. $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[0]{'parent'} = $result_trees{'space_in_image'}{'contents'}[1];
  191. $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'} = $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'args'}[0];
  192. $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'args'}[0]{'contents'}[1]{'parent'} = $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'args'}[0];
  193. $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'args'}[0]{'contents'}[2]{'parent'} = $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'args'}[0];
  194. $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'args'}[0]{'parent'} = $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1];
  195. $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'extra'}{'brace_command_contents'}[0][0] = $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'args'}[0]{'contents'}[1];
  196. $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'extra'}{'spaces_before_argument'} = $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'args'}[0]{'contents'}[0];
  197. $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'line_nr'} = $result_trees{'space_in_image'}{'contents'}[0]{'line_nr'};
  198. $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[1]{'parent'} = $result_trees{'space_in_image'}{'contents'}[1];
  199. $result_trees{'space_in_image'}{'contents'}[1]{'contents'}[2]{'parent'} = $result_trees{'space_in_image'}{'contents'}[1];
  200. $result_trees{'space_in_image'}{'contents'}[1]{'parent'} = $result_trees{'space_in_image'};
  201. $result_texis{'space_in_image'} = '@image{ a ,bb, cc,dd ,e }. @image{ f }.';
  202. $result_texts{'space_in_image'} = 'a. f.';
  203. $result_errors{'space_in_image'} = [];
  204. $result_converted{'plaintext'}->{'space_in_image'} = 'An image text before paragraph.. Another image text, in paragraph..
  205. ';
  206. $result_converted{'html_text'}->{'space_in_image'} = '<img src="a.e" alt="dd"><p>. <img src="f.jpg" alt="f">.</p>';
  207. $result_converted_errors{'html_text'}->{'space_in_image'} = [
  208. {
  209. 'error_line' => ':1: warning: @image file `a\' (for HTML) not found, using `a.e\'
  210. ',
  211. 'file_name' => '',
  212. 'line_nr' => 1,
  213. 'macro' => '',
  214. 'text' => '@image file `a\' (for HTML) not found, using `a.e\'',
  215. 'type' => 'warning'
  216. },
  217. {
  218. 'error_line' => ':1: warning: @image file `f\' (for HTML) not found, using `f.jpg\'
  219. ',
  220. 'file_name' => '',
  221. 'line_nr' => 1,
  222. 'macro' => '',
  223. 'text' => '@image file `f\' (for HTML) not found, using `f.jpg\'',
  224. 'type' => 'warning'
  225. }
  226. ];
  227. 1;