Explorer

html-ui.description-of

description
The description in exactly that language from the description line of definy_get_part ('(en) ...
type
Fn(text: String, language: String) -> String
expression
fn(text$0, language$1) =>
  match @std.string-starts-with(value: $0, prefix: "(") {
    false =>
      match @core.equal(left: $1, right: "en") {
        true =>
          $0,
        false =>
          ""
      },
    true =>
      let padded$2 = @core.string-concat(left: " ", right: $0);
      let at$3 = @core.string-index-of(text: $2, target: @core.string-join(items: [" (", $1, ") "], separator: ""), start: 0);
      match @core.less-than(left: $3, right: 0) {
        true =>
          "",
        false =>
          let from$4 = @core.plus(left: $3, right: 6);
          let next$5 = @html-ui.min-found(
              a: @core.string-index-of(text: $2, target: " (en) ", start: $4),
              b: @html-ui.min-found(
                a: @core.string-index-of(text: $2, target: " (ja) ", start: $4),
                b: @core.string-index-of(text: $2, target: " (eo) ", start: $4)
              )
            );
          @core.string-slice(
            value: $2,
            start: $4,
            end: match @core.less-than(left: $5, right: 0) {
              true =>
                @core.string-length(value: $2),
              false =>
                $5
            }
          )
      }
  }
visibility
public
html-ui.description-of (project html-ui, branch main, snapshot Daaw3vbJhY15cDW6JsA4JuXvffjj_qFyxoZQMUM8hvQ)
id: cllrpd6NgaEgOcFlE4qHtWNlQXvlstCEHvo6PkCTmog
content hash: cIPnBEUbZxo5jIjQvZpJbEDwpcD46UV77ML0Elb_xlA