berns 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 984896367eb9ccf07e00f90254e53fe2785b29f01d66a249165896fd6cee4405
4
- data.tar.gz: 1dd55160c78351148ff1b3aa5fb534d611581c08e9763f216199a3de4103e060
3
+ metadata.gz: c7ce19cd4063f7848679411220f2d525c5958fdfdfa917a8c7afd8f19b273ce7
4
+ data.tar.gz: 2df9ddaa8887bfd8586243d4485a50997bace0e8f72b8ebff1e4a0080be4e265
5
5
  SHA512:
6
- metadata.gz: d35a61f6003231911938482b27931e23a75d4e1edd932199ba284b283399e304d40595cd6ea69582bef6c5be29ed5a7940b5ead74db685b2e62be9ab053715e8
7
- data.tar.gz: 004f9541acfeda32484c9a34679d3f670395c601b128f29f45f8530d892064938345e38b3b3a9e7dbac45e2dc70d31c3d4bd8136e3db870f0a85c0e6fd569af2
6
+ metadata.gz: 87f958f10a1b2a54c9be5bf98113309aa6d7a4f56ae8d67fd2564b27bf21eb0a8b5fa3209da526875e67a1fb5dfa2b4396d1b520a9fc3cd3f599a608cbb63e1e
7
+ data.tar.gz: dde5cf8708da692c34d0ced41eee022ce95575409da67884b4903e27de140aa2487f03e6e5e80ac16c196a42db66e7c76659456a776a22497e96e38c86a44088
data/CHANGELOG.org CHANGED
@@ -1,5 +1,14 @@
1
1
  * Berns Changelog
2
2
 
3
+ ** 3.0.2
4
+
5
+ Ensure all returned strings are UTF-8 encoded.
6
+
7
+ ** 3.0.1
8
+
9
+ Fix a regression when content blocks are nil. They should be treated the same as
10
+ if they are not there instead of throwing an error.
11
+
3
12
  ** 3.0.0
4
13
 
5
14
  Version 3.0 is another mostly API-compatible refactor of Berns, this time in
data/README.org CHANGED
@@ -1,6 +1,6 @@
1
1
  * Berns
2
2
 
3
- [[https://badge.fury.io/rb/berns.svg]]
3
+ [[https://badge.fury.io/rb/berns][https://badge.fury.io/rb/berns.svg]]
4
4
 
5
5
  A utility library for generating HTML strings.
6
6
 
data/ext/berns/berns.c CHANGED
@@ -30,7 +30,7 @@ static VALUE berns_escape_html(const VALUE self, VALUE string) {
30
30
  }
31
31
 
32
32
  static VALUE berns_to_attribute(const VALUE self, VALUE attribute, const VALUE value) {
33
- const VALUE empty = rb_str_new_cstr("");
33
+ const VALUE empty = rb_utf8_str_new_cstr("");
34
34
 
35
35
  VALUE escaped;
36
36
  VALUE key;
@@ -116,7 +116,7 @@ static VALUE berns_to_attribute(const VALUE self, VALUE attribute, const VALUE v
116
116
 
117
117
  stecpy(ptr, RSTRING_PTR(subkey), end);
118
118
 
119
- subattr = berns_to_attribute(self, rb_str_new_cstr(subname), subvalue);
119
+ subattr = berns_to_attribute(self, rb_utf8_str_new_cstr(subname), subvalue);
120
120
  size_t subattrlen = RSTRING_LEN(subattr);
121
121
 
122
122
  if (i > 0) {
@@ -146,7 +146,7 @@ static VALUE berns_to_attribute(const VALUE self, VALUE attribute, const VALUE v
146
146
  }
147
147
  }
148
148
 
149
- rstring = rb_str_new_cstr(substring);
149
+ rstring = rb_utf8_str_new_cstr(substring);
150
150
  free(substring);
151
151
 
152
152
  return rstring;
@@ -172,7 +172,7 @@ static VALUE berns_to_attribute(const VALUE self, VALUE attribute, const VALUE v
172
172
  ptr = stecpy(ptr, RSTRING_PTR(escaped), end);
173
173
  stecpy(ptr, close, end);
174
174
 
175
- return rb_str_new_cstr(string);
175
+ return rb_utf8_str_new_cstr(string);
176
176
  }
177
177
  }
178
178
 
@@ -188,7 +188,7 @@ static VALUE berns_to_attributes(const VALUE self, const VALUE attributes) {
188
188
  const VALUE length = RARRAY_LEN(keys);
189
189
 
190
190
  if (length == 0) {
191
- return rb_str_new_cstr("");
191
+ return rb_utf8_str_new_cstr("");
192
192
  }
193
193
 
194
194
  char *string = NULL;
@@ -230,7 +230,7 @@ static VALUE berns_to_attributes(const VALUE self, const VALUE attributes) {
230
230
  }
231
231
  }
232
232
 
233
- rstring = rb_str_new_cstr(string);
233
+ rstring = rb_utf8_str_new_cstr(string);
234
234
  free(string);
235
235
 
236
236
  return rstring;
@@ -288,7 +288,7 @@ static VALUE berns_internal_void(VALUE tag, VALUE attributes) {
288
288
 
289
289
  stecpy(ptr, close, end);
290
290
 
291
- return rb_str_new_cstr(string);
291
+ return rb_utf8_str_new_cstr(string);
292
292
  }
293
293
 
294
294
  static VALUE berns_internal_element(VALUE tag, VALUE attributes) {
@@ -311,10 +311,10 @@ static VALUE berns_internal_element(VALUE tag, VALUE attributes) {
311
311
  content = rb_yield(Qnil);
312
312
 
313
313
  if (TYPE(content) == T_NIL) {
314
- content = rb_str_new_cstr("");
314
+ content = rb_utf8_str_new_cstr("");
315
315
  }
316
316
  } else {
317
- content = rb_str_new_cstr("");
317
+ content = rb_utf8_str_new_cstr("");
318
318
  }
319
319
 
320
320
  StringValue(content);
@@ -357,7 +357,7 @@ static VALUE berns_internal_element(VALUE tag, VALUE attributes) {
357
357
  ptr = stecpy(ptr, RSTRING_PTR(tag), end);
358
358
  stecpy(ptr, close, end);
359
359
 
360
- return rb_str_new_cstr(string);
360
+ return rb_utf8_str_new_cstr(string);
361
361
  }
362
362
 
363
363
  static VALUE berns_void_element(int argc, VALUE *argv, VALUE self) {
@@ -367,77 +367,77 @@ static VALUE berns_void_element(int argc, VALUE *argv, VALUE self) {
367
367
 
368
368
  static VALUE berns_area_element(int argc, VALUE *argv, VALUE self) {
369
369
  rb_check_arity(argc, 0, 1);
370
- return berns_internal_void(rb_str_new_cstr("area"), argv[0]);
370
+ return berns_internal_void(rb_utf8_str_new_cstr("area"), argv[0]);
371
371
  }
372
372
 
373
373
  static VALUE berns_base_element(int argc, VALUE *argv, VALUE self) {
374
374
  rb_check_arity(argc, 0, 1);
375
- return berns_internal_void(rb_str_new_cstr("base"), argv[0]);
375
+ return berns_internal_void(rb_utf8_str_new_cstr("base"), argv[0]);
376
376
  }
377
377
 
378
378
  static VALUE berns_br_element(int argc, VALUE *argv, VALUE self) {
379
379
  rb_check_arity(argc, 0, 1);
380
- return berns_internal_void(rb_str_new_cstr("br"), argv[0]);
380
+ return berns_internal_void(rb_utf8_str_new_cstr("br"), argv[0]);
381
381
  }
382
382
 
383
383
  static VALUE berns_col_element(int argc, VALUE *argv, VALUE self) {
384
384
  rb_check_arity(argc, 0, 1);
385
- return berns_internal_void(rb_str_new_cstr("col"), argv[0]);
385
+ return berns_internal_void(rb_utf8_str_new_cstr("col"), argv[0]);
386
386
  }
387
387
 
388
388
  static VALUE berns_embed_element(int argc, VALUE *argv, VALUE self) {
389
389
  rb_check_arity(argc, 0, 1);
390
- return berns_internal_void(rb_str_new_cstr("embed"), argv[0]);
390
+ return berns_internal_void(rb_utf8_str_new_cstr("embed"), argv[0]);
391
391
  }
392
392
 
393
393
  static VALUE berns_hr_element(int argc, VALUE *argv, VALUE self) {
394
394
  rb_check_arity(argc, 0, 1);
395
- return berns_internal_void(rb_str_new_cstr("hr"), argv[0]);
395
+ return berns_internal_void(rb_utf8_str_new_cstr("hr"), argv[0]);
396
396
  }
397
397
 
398
398
  static VALUE berns_img_element(int argc, VALUE *argv, VALUE self) {
399
399
  rb_check_arity(argc, 0, 1);
400
- return berns_internal_void(rb_str_new_cstr("img"), argv[0]);
400
+ return berns_internal_void(rb_utf8_str_new_cstr("img"), argv[0]);
401
401
  }
402
402
 
403
403
  static VALUE berns_input_element(int argc, VALUE *argv, VALUE self) {
404
404
  rb_check_arity(argc, 0, 1);
405
- return berns_internal_void(rb_str_new_cstr("input"), argv[0]);
405
+ return berns_internal_void(rb_utf8_str_new_cstr("input"), argv[0]);
406
406
  }
407
407
 
408
408
  static VALUE berns_link_element(int argc, VALUE *argv, VALUE self) {
409
409
  rb_check_arity(argc, 0, 1);
410
- return berns_internal_void(rb_str_new_cstr("link"), argv[0]);
410
+ return berns_internal_void(rb_utf8_str_new_cstr("link"), argv[0]);
411
411
  }
412
412
 
413
413
  static VALUE berns_menuitem_element(int argc, VALUE *argv, VALUE self) {
414
414
  rb_check_arity(argc, 0, 1);
415
- return berns_internal_void(rb_str_new_cstr("menuitem"), argv[0]);
415
+ return berns_internal_void(rb_utf8_str_new_cstr("menuitem"), argv[0]);
416
416
  }
417
417
 
418
418
  static VALUE berns_meta_element(int argc, VALUE *argv, VALUE self) {
419
419
  rb_check_arity(argc, 0, 1);
420
- return berns_internal_void(rb_str_new_cstr("meta"), argv[0]);
420
+ return berns_internal_void(rb_utf8_str_new_cstr("meta"), argv[0]);
421
421
  }
422
422
 
423
423
  static VALUE berns_param_element(int argc, VALUE *argv, VALUE self) {
424
424
  rb_check_arity(argc, 0, 1);
425
- return berns_internal_void(rb_str_new_cstr("param"), argv[0]);
425
+ return berns_internal_void(rb_utf8_str_new_cstr("param"), argv[0]);
426
426
  }
427
427
 
428
428
  static VALUE berns_source_element(int argc, VALUE *argv, VALUE self) {
429
429
  rb_check_arity(argc, 0, 1);
430
- return berns_internal_void(rb_str_new_cstr("source"), argv[0]);
430
+ return berns_internal_void(rb_utf8_str_new_cstr("source"), argv[0]);
431
431
  }
432
432
 
433
433
  static VALUE berns_track_element(int argc, VALUE *argv, VALUE self) {
434
434
  rb_check_arity(argc, 0, 1);
435
- return berns_internal_void(rb_str_new_cstr("track"), argv[0]);
435
+ return berns_internal_void(rb_utf8_str_new_cstr("track"), argv[0]);
436
436
  }
437
437
 
438
438
  static VALUE berns_wbr_element(int argc, VALUE *argv, VALUE self) {
439
439
  rb_check_arity(argc, 0, 1);
440
- return berns_internal_void(rb_str_new_cstr("wbr"), argv[0]);
440
+ return berns_internal_void(rb_utf8_str_new_cstr("wbr"), argv[0]);
441
441
  }
442
442
 
443
443
  static VALUE berns_element(int argc, VALUE* argv, VALUE self) {
@@ -447,472 +447,472 @@ static VALUE berns_element(int argc, VALUE* argv, VALUE self) {
447
447
 
448
448
  static VALUE berns_a_element(int argc, VALUE* argv, VALUE self) {
449
449
  rb_check_arity(argc, 0, 1);
450
- return berns_internal_element(rb_str_new_cstr("a"), argv[0]);
450
+ return berns_internal_element(rb_utf8_str_new_cstr("a"), argv[0]);
451
451
  }
452
452
 
453
453
  static VALUE berns_abbr_element(int argc, VALUE* argv, VALUE self) {
454
454
  rb_check_arity(argc, 0, 1);
455
- return berns_internal_element(rb_str_new_cstr("abbr"), argv[0]);
455
+ return berns_internal_element(rb_utf8_str_new_cstr("abbr"), argv[0]);
456
456
  }
457
457
 
458
458
  static VALUE berns_address_element(int argc, VALUE* argv, VALUE self) {
459
459
  rb_check_arity(argc, 0, 1);
460
- return berns_internal_element(rb_str_new_cstr("address"), argv[0]);
460
+ return berns_internal_element(rb_utf8_str_new_cstr("address"), argv[0]);
461
461
  }
462
462
 
463
463
  static VALUE berns_article_element(int argc, VALUE* argv, VALUE self) {
464
464
  rb_check_arity(argc, 0, 1);
465
- return berns_internal_element(rb_str_new_cstr("article"), argv[0]);
465
+ return berns_internal_element(rb_utf8_str_new_cstr("article"), argv[0]);
466
466
  }
467
467
 
468
468
  static VALUE berns_aside_element(int argc, VALUE* argv, VALUE self) {
469
469
  rb_check_arity(argc, 0, 1);
470
- return berns_internal_element(rb_str_new_cstr("aside"), argv[0]);
470
+ return berns_internal_element(rb_utf8_str_new_cstr("aside"), argv[0]);
471
471
  }
472
472
 
473
473
  static VALUE berns_audio_element(int argc, VALUE* argv, VALUE self) {
474
474
  rb_check_arity(argc, 0, 1);
475
- return berns_internal_element(rb_str_new_cstr("audio"), argv[0]);
475
+ return berns_internal_element(rb_utf8_str_new_cstr("audio"), argv[0]);
476
476
  }
477
477
 
478
478
  static VALUE berns_b_element(int argc, VALUE* argv, VALUE self) {
479
479
  rb_check_arity(argc, 0, 1);
480
- return berns_internal_element(rb_str_new_cstr("b"), argv[0]);
480
+ return berns_internal_element(rb_utf8_str_new_cstr("b"), argv[0]);
481
481
  }
482
482
 
483
483
  static VALUE berns_bdi_element(int argc, VALUE* argv, VALUE self) {
484
484
  rb_check_arity(argc, 0, 1);
485
- return berns_internal_element(rb_str_new_cstr("bdi"), argv[0]);
485
+ return berns_internal_element(rb_utf8_str_new_cstr("bdi"), argv[0]);
486
486
  }
487
487
 
488
488
  static VALUE berns_bdo_element(int argc, VALUE* argv, VALUE self) {
489
489
  rb_check_arity(argc, 0, 1);
490
- return berns_internal_element(rb_str_new_cstr("bdo"), argv[0]);
490
+ return berns_internal_element(rb_utf8_str_new_cstr("bdo"), argv[0]);
491
491
  }
492
492
 
493
493
  static VALUE berns_blockquote_element(int argc, VALUE* argv, VALUE self) {
494
494
  rb_check_arity(argc, 0, 1);
495
- return berns_internal_element(rb_str_new_cstr("blockquote"), argv[0]);
495
+ return berns_internal_element(rb_utf8_str_new_cstr("blockquote"), argv[0]);
496
496
  }
497
497
 
498
498
  static VALUE berns_body_element(int argc, VALUE* argv, VALUE self) {
499
499
  rb_check_arity(argc, 0, 1);
500
- return berns_internal_element(rb_str_new_cstr("body"), argv[0]);
500
+ return berns_internal_element(rb_utf8_str_new_cstr("body"), argv[0]);
501
501
  }
502
502
 
503
503
  static VALUE berns_button_element(int argc, VALUE* argv, VALUE self) {
504
504
  rb_check_arity(argc, 0, 1);
505
- return berns_internal_element(rb_str_new_cstr("button"), argv[0]);
505
+ return berns_internal_element(rb_utf8_str_new_cstr("button"), argv[0]);
506
506
  }
507
507
 
508
508
  static VALUE berns_canvas_element(int argc, VALUE* argv, VALUE self) {
509
509
  rb_check_arity(argc, 0, 1);
510
- return berns_internal_element(rb_str_new_cstr("canvas"), argv[0]);
510
+ return berns_internal_element(rb_utf8_str_new_cstr("canvas"), argv[0]);
511
511
  }
512
512
 
513
513
  static VALUE berns_caption_element(int argc, VALUE* argv, VALUE self) {
514
514
  rb_check_arity(argc, 0, 1);
515
- return berns_internal_element(rb_str_new_cstr("caption"), argv[0]);
515
+ return berns_internal_element(rb_utf8_str_new_cstr("caption"), argv[0]);
516
516
  }
517
517
 
518
518
  static VALUE berns_cite_element(int argc, VALUE* argv, VALUE self) {
519
519
  rb_check_arity(argc, 0, 1);
520
- return berns_internal_element(rb_str_new_cstr("cite"), argv[0]);
520
+ return berns_internal_element(rb_utf8_str_new_cstr("cite"), argv[0]);
521
521
  }
522
522
 
523
523
  static VALUE berns_code_element(int argc, VALUE* argv, VALUE self) {
524
524
  rb_check_arity(argc, 0, 1);
525
- return berns_internal_element(rb_str_new_cstr("code"), argv[0]);
525
+ return berns_internal_element(rb_utf8_str_new_cstr("code"), argv[0]);
526
526
  }
527
527
 
528
528
  static VALUE berns_colgroup_element(int argc, VALUE* argv, VALUE self) {
529
529
  rb_check_arity(argc, 0, 1);
530
- return berns_internal_element(rb_str_new_cstr("colgroup"), argv[0]);
530
+ return berns_internal_element(rb_utf8_str_new_cstr("colgroup"), argv[0]);
531
531
  }
532
532
 
533
533
  static VALUE berns_datalist_element(int argc, VALUE* argv, VALUE self) {
534
534
  rb_check_arity(argc, 0, 1);
535
- return berns_internal_element(rb_str_new_cstr("datalist"), argv[0]);
535
+ return berns_internal_element(rb_utf8_str_new_cstr("datalist"), argv[0]);
536
536
  }
537
537
 
538
538
  static VALUE berns_dd_element(int argc, VALUE* argv, VALUE self) {
539
539
  rb_check_arity(argc, 0, 1);
540
- return berns_internal_element(rb_str_new_cstr("dd"), argv[0]);
540
+ return berns_internal_element(rb_utf8_str_new_cstr("dd"), argv[0]);
541
541
  }
542
542
 
543
543
  static VALUE berns_del_element(int argc, VALUE* argv, VALUE self) {
544
544
  rb_check_arity(argc, 0, 1);
545
- return berns_internal_element(rb_str_new_cstr("del"), argv[0]);
545
+ return berns_internal_element(rb_utf8_str_new_cstr("del"), argv[0]);
546
546
  }
547
547
 
548
548
  static VALUE berns_details_element(int argc, VALUE* argv, VALUE self) {
549
549
  rb_check_arity(argc, 0, 1);
550
- return berns_internal_element(rb_str_new_cstr("details"), argv[0]);
550
+ return berns_internal_element(rb_utf8_str_new_cstr("details"), argv[0]);
551
551
  }
552
552
 
553
553
  static VALUE berns_dfn_element(int argc, VALUE* argv, VALUE self) {
554
554
  rb_check_arity(argc, 0, 1);
555
- return berns_internal_element(rb_str_new_cstr("dfn"), argv[0]);
555
+ return berns_internal_element(rb_utf8_str_new_cstr("dfn"), argv[0]);
556
556
  }
557
557
 
558
558
  static VALUE berns_dialog_element(int argc, VALUE* argv, VALUE self) {
559
559
  rb_check_arity(argc, 0, 1);
560
- return berns_internal_element(rb_str_new_cstr("dialog"), argv[0]);
560
+ return berns_internal_element(rb_utf8_str_new_cstr("dialog"), argv[0]);
561
561
  }
562
562
 
563
563
  static VALUE berns_div_element(int argc, VALUE* argv, VALUE self) {
564
564
  rb_check_arity(argc, 0, 1);
565
- return berns_internal_element(rb_str_new_cstr("div"), argv[0]);
565
+ return berns_internal_element(rb_utf8_str_new_cstr("div"), argv[0]);
566
566
  }
567
567
 
568
568
  static VALUE berns_dl_element(int argc, VALUE* argv, VALUE self) {
569
569
  rb_check_arity(argc, 0, 1);
570
- return berns_internal_element(rb_str_new_cstr("dl"), argv[0]);
570
+ return berns_internal_element(rb_utf8_str_new_cstr("dl"), argv[0]);
571
571
  }
572
572
 
573
573
  static VALUE berns_dt_element(int argc, VALUE* argv, VALUE self) {
574
574
  rb_check_arity(argc, 0, 1);
575
- return berns_internal_element(rb_str_new_cstr("dt"), argv[0]);
575
+ return berns_internal_element(rb_utf8_str_new_cstr("dt"), argv[0]);
576
576
  }
577
577
 
578
578
  static VALUE berns_em_element(int argc, VALUE* argv, VALUE self) {
579
579
  rb_check_arity(argc, 0, 1);
580
- return berns_internal_element(rb_str_new_cstr("em"), argv[0]);
580
+ return berns_internal_element(rb_utf8_str_new_cstr("em"), argv[0]);
581
581
  }
582
582
 
583
583
  static VALUE berns_fieldset_element(int argc, VALUE* argv, VALUE self) {
584
584
  rb_check_arity(argc, 0, 1);
585
- return berns_internal_element(rb_str_new_cstr("fieldset"), argv[0]);
585
+ return berns_internal_element(rb_utf8_str_new_cstr("fieldset"), argv[0]);
586
586
  }
587
587
 
588
588
  static VALUE berns_figcaption_element(int argc, VALUE* argv, VALUE self) {
589
589
  rb_check_arity(argc, 0, 1);
590
- return berns_internal_element(rb_str_new_cstr("figcaption"), argv[0]);
590
+ return berns_internal_element(rb_utf8_str_new_cstr("figcaption"), argv[0]);
591
591
  }
592
592
 
593
593
  static VALUE berns_figure_element(int argc, VALUE* argv, VALUE self) {
594
594
  rb_check_arity(argc, 0, 1);
595
- return berns_internal_element(rb_str_new_cstr("figure"), argv[0]);
595
+ return berns_internal_element(rb_utf8_str_new_cstr("figure"), argv[0]);
596
596
  }
597
597
 
598
598
  static VALUE berns_footer_element(int argc, VALUE* argv, VALUE self) {
599
599
  rb_check_arity(argc, 0, 1);
600
- return berns_internal_element(rb_str_new_cstr("footer"), argv[0]);
600
+ return berns_internal_element(rb_utf8_str_new_cstr("footer"), argv[0]);
601
601
  }
602
602
 
603
603
  static VALUE berns_form_element(int argc, VALUE* argv, VALUE self) {
604
604
  rb_check_arity(argc, 0, 1);
605
- return berns_internal_element(rb_str_new_cstr("form"), argv[0]);
605
+ return berns_internal_element(rb_utf8_str_new_cstr("form"), argv[0]);
606
606
  }
607
607
 
608
608
  static VALUE berns_h1_element(int argc, VALUE* argv, VALUE self) {
609
609
  rb_check_arity(argc, 0, 1);
610
- return berns_internal_element(rb_str_new_cstr("h1"), argv[0]);
610
+ return berns_internal_element(rb_utf8_str_new_cstr("h1"), argv[0]);
611
611
  }
612
612
 
613
613
  static VALUE berns_h2_element(int argc, VALUE* argv, VALUE self) {
614
614
  rb_check_arity(argc, 0, 1);
615
- return berns_internal_element(rb_str_new_cstr("h2"), argv[0]);
615
+ return berns_internal_element(rb_utf8_str_new_cstr("h2"), argv[0]);
616
616
  }
617
617
 
618
618
  static VALUE berns_h3_element(int argc, VALUE* argv, VALUE self) {
619
619
  rb_check_arity(argc, 0, 1);
620
- return berns_internal_element(rb_str_new_cstr("h3"), argv[0]);
620
+ return berns_internal_element(rb_utf8_str_new_cstr("h3"), argv[0]);
621
621
  }
622
622
 
623
623
  static VALUE berns_h4_element(int argc, VALUE* argv, VALUE self) {
624
624
  rb_check_arity(argc, 0, 1);
625
- return berns_internal_element(rb_str_new_cstr("h4"), argv[0]);
625
+ return berns_internal_element(rb_utf8_str_new_cstr("h4"), argv[0]);
626
626
  }
627
627
 
628
628
  static VALUE berns_h5_element(int argc, VALUE* argv, VALUE self) {
629
629
  rb_check_arity(argc, 0, 1);
630
- return berns_internal_element(rb_str_new_cstr("h5"), argv[0]);
630
+ return berns_internal_element(rb_utf8_str_new_cstr("h5"), argv[0]);
631
631
  }
632
632
 
633
633
  static VALUE berns_h6_element(int argc, VALUE* argv, VALUE self) {
634
634
  rb_check_arity(argc, 0, 1);
635
- return berns_internal_element(rb_str_new_cstr("h6"), argv[0]);
635
+ return berns_internal_element(rb_utf8_str_new_cstr("h6"), argv[0]);
636
636
  }
637
637
 
638
638
  static VALUE berns_head_element(int argc, VALUE* argv, VALUE self) {
639
639
  rb_check_arity(argc, 0, 1);
640
- return berns_internal_element(rb_str_new_cstr("head"), argv[0]);
640
+ return berns_internal_element(rb_utf8_str_new_cstr("head"), argv[0]);
641
641
  }
642
642
 
643
643
  static VALUE berns_header_element(int argc, VALUE* argv, VALUE self) {
644
644
  rb_check_arity(argc, 0, 1);
645
- return berns_internal_element(rb_str_new_cstr("header"), argv[0]);
645
+ return berns_internal_element(rb_utf8_str_new_cstr("header"), argv[0]);
646
646
  }
647
647
 
648
648
  static VALUE berns_html_element(int argc, VALUE* argv, VALUE self) {
649
649
  rb_check_arity(argc, 0, 1);
650
- return berns_internal_element(rb_str_new_cstr("html"), argv[0]);
650
+ return berns_internal_element(rb_utf8_str_new_cstr("html"), argv[0]);
651
651
  }
652
652
 
653
653
  static VALUE berns_i_element(int argc, VALUE* argv, VALUE self) {
654
654
  rb_check_arity(argc, 0, 1);
655
- return berns_internal_element(rb_str_new_cstr("i"), argv[0]);
655
+ return berns_internal_element(rb_utf8_str_new_cstr("i"), argv[0]);
656
656
  }
657
657
 
658
658
  static VALUE berns_iframe_element(int argc, VALUE* argv, VALUE self) {
659
659
  rb_check_arity(argc, 0, 1);
660
- return berns_internal_element(rb_str_new_cstr("iframe"), argv[0]);
660
+ return berns_internal_element(rb_utf8_str_new_cstr("iframe"), argv[0]);
661
661
  }
662
662
 
663
663
  static VALUE berns_ins_element(int argc, VALUE* argv, VALUE self) {
664
664
  rb_check_arity(argc, 0, 1);
665
- return berns_internal_element(rb_str_new_cstr("ins"), argv[0]);
665
+ return berns_internal_element(rb_utf8_str_new_cstr("ins"), argv[0]);
666
666
  }
667
667
 
668
668
  static VALUE berns_kbd_element(int argc, VALUE* argv, VALUE self) {
669
669
  rb_check_arity(argc, 0, 1);
670
- return berns_internal_element(rb_str_new_cstr("kbd"), argv[0]);
670
+ return berns_internal_element(rb_utf8_str_new_cstr("kbd"), argv[0]);
671
671
  }
672
672
 
673
673
  static VALUE berns_label_element(int argc, VALUE* argv, VALUE self) {
674
674
  rb_check_arity(argc, 0, 1);
675
- return berns_internal_element(rb_str_new_cstr("label"), argv[0]);
675
+ return berns_internal_element(rb_utf8_str_new_cstr("label"), argv[0]);
676
676
  }
677
677
 
678
678
  static VALUE berns_legend_element(int argc, VALUE* argv, VALUE self) {
679
679
  rb_check_arity(argc, 0, 1);
680
- return berns_internal_element(rb_str_new_cstr("legend"), argv[0]);
680
+ return berns_internal_element(rb_utf8_str_new_cstr("legend"), argv[0]);
681
681
  }
682
682
 
683
683
  static VALUE berns_li_element(int argc, VALUE* argv, VALUE self) {
684
684
  rb_check_arity(argc, 0, 1);
685
- return berns_internal_element(rb_str_new_cstr("li"), argv[0]);
685
+ return berns_internal_element(rb_utf8_str_new_cstr("li"), argv[0]);
686
686
  }
687
687
 
688
688
  static VALUE berns_main_element(int argc, VALUE* argv, VALUE self) {
689
689
  rb_check_arity(argc, 0, 1);
690
- return berns_internal_element(rb_str_new_cstr("main"), argv[0]);
690
+ return berns_internal_element(rb_utf8_str_new_cstr("main"), argv[0]);
691
691
  }
692
692
 
693
693
  static VALUE berns_map_element(int argc, VALUE* argv, VALUE self) {
694
694
  rb_check_arity(argc, 0, 1);
695
- return berns_internal_element(rb_str_new_cstr("map"), argv[0]);
695
+ return berns_internal_element(rb_utf8_str_new_cstr("map"), argv[0]);
696
696
  }
697
697
 
698
698
  static VALUE berns_mark_element(int argc, VALUE* argv, VALUE self) {
699
699
  rb_check_arity(argc, 0, 1);
700
- return berns_internal_element(rb_str_new_cstr("mark"), argv[0]);
700
+ return berns_internal_element(rb_utf8_str_new_cstr("mark"), argv[0]);
701
701
  }
702
702
 
703
703
  static VALUE berns_menu_element(int argc, VALUE* argv, VALUE self) {
704
704
  rb_check_arity(argc, 0, 1);
705
- return berns_internal_element(rb_str_new_cstr("menu"), argv[0]);
705
+ return berns_internal_element(rb_utf8_str_new_cstr("menu"), argv[0]);
706
706
  }
707
707
 
708
708
  static VALUE berns_meter_element(int argc, VALUE* argv, VALUE self) {
709
709
  rb_check_arity(argc, 0, 1);
710
- return berns_internal_element(rb_str_new_cstr("meter"), argv[0]);
710
+ return berns_internal_element(rb_utf8_str_new_cstr("meter"), argv[0]);
711
711
  }
712
712
 
713
713
  static VALUE berns_nav_element(int argc, VALUE* argv, VALUE self) {
714
714
  rb_check_arity(argc, 0, 1);
715
- return berns_internal_element(rb_str_new_cstr("nav"), argv[0]);
715
+ return berns_internal_element(rb_utf8_str_new_cstr("nav"), argv[0]);
716
716
  }
717
717
 
718
718
  static VALUE berns_noscript_element(int argc, VALUE* argv, VALUE self) {
719
719
  rb_check_arity(argc, 0, 1);
720
- return berns_internal_element(rb_str_new_cstr("noscript"), argv[0]);
720
+ return berns_internal_element(rb_utf8_str_new_cstr("noscript"), argv[0]);
721
721
  }
722
722
 
723
723
  static VALUE berns_object_element(int argc, VALUE* argv, VALUE self) {
724
724
  rb_check_arity(argc, 0, 1);
725
- return berns_internal_element(rb_str_new_cstr("object"), argv[0]);
725
+ return berns_internal_element(rb_utf8_str_new_cstr("object"), argv[0]);
726
726
  }
727
727
 
728
728
  static VALUE berns_ol_element(int argc, VALUE* argv, VALUE self) {
729
729
  rb_check_arity(argc, 0, 1);
730
- return berns_internal_element(rb_str_new_cstr("ol"), argv[0]);
730
+ return berns_internal_element(rb_utf8_str_new_cstr("ol"), argv[0]);
731
731
  }
732
732
 
733
733
  static VALUE berns_optgroup_element(int argc, VALUE* argv, VALUE self) {
734
734
  rb_check_arity(argc, 0, 1);
735
- return berns_internal_element(rb_str_new_cstr("optgroup"), argv[0]);
735
+ return berns_internal_element(rb_utf8_str_new_cstr("optgroup"), argv[0]);
736
736
  }
737
737
 
738
738
  static VALUE berns_option_element(int argc, VALUE* argv, VALUE self) {
739
739
  rb_check_arity(argc, 0, 1);
740
- return berns_internal_element(rb_str_new_cstr("option"), argv[0]);
740
+ return berns_internal_element(rb_utf8_str_new_cstr("option"), argv[0]);
741
741
  }
742
742
 
743
743
  static VALUE berns_output_element(int argc, VALUE* argv, VALUE self) {
744
744
  rb_check_arity(argc, 0, 1);
745
- return berns_internal_element(rb_str_new_cstr("output"), argv[0]);
745
+ return berns_internal_element(rb_utf8_str_new_cstr("output"), argv[0]);
746
746
  }
747
747
 
748
748
  static VALUE berns_p_element(int argc, VALUE* argv, VALUE self) {
749
749
  rb_check_arity(argc, 0, 1);
750
- return berns_internal_element(rb_str_new_cstr("p"), argv[0]);
750
+ return berns_internal_element(rb_utf8_str_new_cstr("p"), argv[0]);
751
751
  }
752
752
 
753
753
  static VALUE berns_picture_element(int argc, VALUE* argv, VALUE self) {
754
754
  rb_check_arity(argc, 0, 1);
755
- return berns_internal_element(rb_str_new_cstr("picture"), argv[0]);
755
+ return berns_internal_element(rb_utf8_str_new_cstr("picture"), argv[0]);
756
756
  }
757
757
 
758
758
  static VALUE berns_pre_element(int argc, VALUE* argv, VALUE self) {
759
759
  rb_check_arity(argc, 0, 1);
760
- return berns_internal_element(rb_str_new_cstr("pre"), argv[0]);
760
+ return berns_internal_element(rb_utf8_str_new_cstr("pre"), argv[0]);
761
761
  }
762
762
 
763
763
  static VALUE berns_progress_element(int argc, VALUE* argv, VALUE self) {
764
764
  rb_check_arity(argc, 0, 1);
765
- return berns_internal_element(rb_str_new_cstr("progress"), argv[0]);
765
+ return berns_internal_element(rb_utf8_str_new_cstr("progress"), argv[0]);
766
766
  }
767
767
 
768
768
  static VALUE berns_q_element(int argc, VALUE* argv, VALUE self) {
769
769
  rb_check_arity(argc, 0, 1);
770
- return berns_internal_element(rb_str_new_cstr("q"), argv[0]);
770
+ return berns_internal_element(rb_utf8_str_new_cstr("q"), argv[0]);
771
771
  }
772
772
 
773
773
  static VALUE berns_rp_element(int argc, VALUE* argv, VALUE self) {
774
774
  rb_check_arity(argc, 0, 1);
775
- return berns_internal_element(rb_str_new_cstr("rp"), argv[0]);
775
+ return berns_internal_element(rb_utf8_str_new_cstr("rp"), argv[0]);
776
776
  }
777
777
 
778
778
  static VALUE berns_rt_element(int argc, VALUE* argv, VALUE self) {
779
779
  rb_check_arity(argc, 0, 1);
780
- return berns_internal_element(rb_str_new_cstr("rt"), argv[0]);
780
+ return berns_internal_element(rb_utf8_str_new_cstr("rt"), argv[0]);
781
781
  }
782
782
 
783
783
  static VALUE berns_ruby_element(int argc, VALUE* argv, VALUE self) {
784
784
  rb_check_arity(argc, 0, 1);
785
- return berns_internal_element(rb_str_new_cstr("ruby"), argv[0]);
785
+ return berns_internal_element(rb_utf8_str_new_cstr("ruby"), argv[0]);
786
786
  }
787
787
 
788
788
  static VALUE berns_s_element(int argc, VALUE* argv, VALUE self) {
789
789
  rb_check_arity(argc, 0, 1);
790
- return berns_internal_element(rb_str_new_cstr("s"), argv[0]);
790
+ return berns_internal_element(rb_utf8_str_new_cstr("s"), argv[0]);
791
791
  }
792
792
 
793
793
  static VALUE berns_samp_element(int argc, VALUE* argv, VALUE self) {
794
794
  rb_check_arity(argc, 0, 1);
795
- return berns_internal_element(rb_str_new_cstr("samp"), argv[0]);
795
+ return berns_internal_element(rb_utf8_str_new_cstr("samp"), argv[0]);
796
796
  }
797
797
 
798
798
  static VALUE berns_script_element(int argc, VALUE* argv, VALUE self) {
799
799
  rb_check_arity(argc, 0, 1);
800
- return berns_internal_element(rb_str_new_cstr("script"), argv[0]);
800
+ return berns_internal_element(rb_utf8_str_new_cstr("script"), argv[0]);
801
801
  }
802
802
 
803
803
  static VALUE berns_section_element(int argc, VALUE* argv, VALUE self) {
804
804
  rb_check_arity(argc, 0, 1);
805
- return berns_internal_element(rb_str_new_cstr("section"), argv[0]);
805
+ return berns_internal_element(rb_utf8_str_new_cstr("section"), argv[0]);
806
806
  }
807
807
 
808
808
  static VALUE berns_select_element(int argc, VALUE* argv, VALUE self) {
809
809
  rb_check_arity(argc, 0, 1);
810
- return berns_internal_element(rb_str_new_cstr("select"), argv[0]);
810
+ return berns_internal_element(rb_utf8_str_new_cstr("select"), argv[0]);
811
811
  }
812
812
 
813
813
  static VALUE berns_small_element(int argc, VALUE* argv, VALUE self) {
814
814
  rb_check_arity(argc, 0, 1);
815
- return berns_internal_element(rb_str_new_cstr("small"), argv[0]);
815
+ return berns_internal_element(rb_utf8_str_new_cstr("small"), argv[0]);
816
816
  }
817
817
 
818
818
  static VALUE berns_span_element(int argc, VALUE* argv, VALUE self) {
819
819
  rb_check_arity(argc, 0, 1);
820
- return berns_internal_element(rb_str_new_cstr("span"), argv[0]);
820
+ return berns_internal_element(rb_utf8_str_new_cstr("span"), argv[0]);
821
821
  }
822
822
 
823
823
  static VALUE berns_strong_element(int argc, VALUE* argv, VALUE self) {
824
824
  rb_check_arity(argc, 0, 1);
825
- return berns_internal_element(rb_str_new_cstr("strong"), argv[0]);
825
+ return berns_internal_element(rb_utf8_str_new_cstr("strong"), argv[0]);
826
826
  }
827
827
 
828
828
  static VALUE berns_style_element(int argc, VALUE* argv, VALUE self) {
829
829
  rb_check_arity(argc, 0, 1);
830
- return berns_internal_element(rb_str_new_cstr("style"), argv[0]);
830
+ return berns_internal_element(rb_utf8_str_new_cstr("style"), argv[0]);
831
831
  }
832
832
 
833
833
  static VALUE berns_sub_element(int argc, VALUE* argv, VALUE self) {
834
834
  rb_check_arity(argc, 0, 1);
835
- return berns_internal_element(rb_str_new_cstr("sub"), argv[0]);
835
+ return berns_internal_element(rb_utf8_str_new_cstr("sub"), argv[0]);
836
836
  }
837
837
 
838
838
  static VALUE berns_summary_element(int argc, VALUE* argv, VALUE self) {
839
839
  rb_check_arity(argc, 0, 1);
840
- return berns_internal_element(rb_str_new_cstr("summary"), argv[0]);
840
+ return berns_internal_element(rb_utf8_str_new_cstr("summary"), argv[0]);
841
841
  }
842
842
 
843
843
  static VALUE berns_table_element(int argc, VALUE* argv, VALUE self) {
844
844
  rb_check_arity(argc, 0, 1);
845
- return berns_internal_element(rb_str_new_cstr("table"), argv[0]);
845
+ return berns_internal_element(rb_utf8_str_new_cstr("table"), argv[0]);
846
846
  }
847
847
 
848
848
  static VALUE berns_tbody_element(int argc, VALUE* argv, VALUE self) {
849
849
  rb_check_arity(argc, 0, 1);
850
- return berns_internal_element(rb_str_new_cstr("tbody"), argv[0]);
850
+ return berns_internal_element(rb_utf8_str_new_cstr("tbody"), argv[0]);
851
851
  }
852
852
 
853
853
  static VALUE berns_td_element(int argc, VALUE* argv, VALUE self) {
854
854
  rb_check_arity(argc, 0, 1);
855
- return berns_internal_element(rb_str_new_cstr("td"), argv[0]);
855
+ return berns_internal_element(rb_utf8_str_new_cstr("td"), argv[0]);
856
856
  }
857
857
 
858
858
  static VALUE berns_template_element(int argc, VALUE* argv, VALUE self) {
859
859
  rb_check_arity(argc, 0, 1);
860
- return berns_internal_element(rb_str_new_cstr("template"), argv[0]);
860
+ return berns_internal_element(rb_utf8_str_new_cstr("template"), argv[0]);
861
861
  }
862
862
 
863
863
  static VALUE berns_textarea_element(int argc, VALUE* argv, VALUE self) {
864
864
  rb_check_arity(argc, 0, 1);
865
- return berns_internal_element(rb_str_new_cstr("textarea"), argv[0]);
865
+ return berns_internal_element(rb_utf8_str_new_cstr("textarea"), argv[0]);
866
866
  }
867
867
 
868
868
  static VALUE berns_tfoot_element(int argc, VALUE* argv, VALUE self) {
869
869
  rb_check_arity(argc, 0, 1);
870
- return berns_internal_element(rb_str_new_cstr("tfoot"), argv[0]);
870
+ return berns_internal_element(rb_utf8_str_new_cstr("tfoot"), argv[0]);
871
871
  }
872
872
 
873
873
  static VALUE berns_th_element(int argc, VALUE* argv, VALUE self) {
874
874
  rb_check_arity(argc, 0, 1);
875
- return berns_internal_element(rb_str_new_cstr("th"), argv[0]);
875
+ return berns_internal_element(rb_utf8_str_new_cstr("th"), argv[0]);
876
876
  }
877
877
 
878
878
  static VALUE berns_thead_element(int argc, VALUE* argv, VALUE self) {
879
879
  rb_check_arity(argc, 0, 1);
880
- return berns_internal_element(rb_str_new_cstr("thead"), argv[0]);
880
+ return berns_internal_element(rb_utf8_str_new_cstr("thead"), argv[0]);
881
881
  }
882
882
 
883
883
  static VALUE berns_time_element(int argc, VALUE* argv, VALUE self) {
884
884
  rb_check_arity(argc, 0, 1);
885
- return berns_internal_element(rb_str_new_cstr("time"), argv[0]);
885
+ return berns_internal_element(rb_utf8_str_new_cstr("time"), argv[0]);
886
886
  }
887
887
 
888
888
  static VALUE berns_title_element(int argc, VALUE* argv, VALUE self) {
889
889
  rb_check_arity(argc, 0, 1);
890
- return berns_internal_element(rb_str_new_cstr("title"), argv[0]);
890
+ return berns_internal_element(rb_utf8_str_new_cstr("title"), argv[0]);
891
891
  }
892
892
 
893
893
  static VALUE berns_tr_element(int argc, VALUE* argv, VALUE self) {
894
894
  rb_check_arity(argc, 0, 1);
895
- return berns_internal_element(rb_str_new_cstr("tr"), argv[0]);
895
+ return berns_internal_element(rb_utf8_str_new_cstr("tr"), argv[0]);
896
896
  }
897
897
 
898
898
  static VALUE berns_u_element(int argc, VALUE* argv, VALUE self) {
899
899
  rb_check_arity(argc, 0, 1);
900
- return berns_internal_element(rb_str_new_cstr("u"), argv[0]);
900
+ return berns_internal_element(rb_utf8_str_new_cstr("u"), argv[0]);
901
901
  }
902
902
 
903
903
  static VALUE berns_ul_element(int argc, VALUE* argv, VALUE self) {
904
904
  rb_check_arity(argc, 0, 1);
905
- return berns_internal_element(rb_str_new_cstr("ul"), argv[0]);
905
+ return berns_internal_element(rb_utf8_str_new_cstr("ul"), argv[0]);
906
906
  }
907
907
 
908
908
  static VALUE berns_var_element(int argc, VALUE* argv, VALUE self) {
909
909
  rb_check_arity(argc, 0, 1);
910
- return berns_internal_element(rb_str_new_cstr("var"), argv[0]);
910
+ return berns_internal_element(rb_utf8_str_new_cstr("var"), argv[0]);
911
911
  }
912
912
 
913
913
  static VALUE berns_video_element(int argc, VALUE* argv, VALUE self) {
914
914
  rb_check_arity(argc, 0, 1);
915
- return berns_internal_element(rb_str_new_cstr("video"), argv[0]);
915
+ return berns_internal_element(rb_utf8_str_new_cstr("video"), argv[0]);
916
916
  }
917
917
 
918
918
  void Init_berns() {
data/lib/berns/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Berns
3
- VERSION = '3.0.1'
3
+ VERSION = '3.0.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berns
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Beck