Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax committed Jan 25, 2025
1 parent cd76d56 commit f5d81a3
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 39 deletions.
2 changes: 0 additions & 2 deletions config/yaml/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
| نام ویژگی | توضیح | تولید |
|-----------|------------|-------|
| `منبع` | | `href` |
| `لینک` | | `src` |

<h2 id="include">دستور <code>بارگیری</code></h2>

Expand Down Expand Up @@ -426,7 +425,6 @@
| نام ویژگی | توضیح | تولید |
|-----------|------------|-------|
| `منبع` | | `src` |
| `لینک` | | `src` |

<h2 id="font">دستور <code>قلم</code></h2>

Expand Down
14 changes: 0 additions & 14 deletions config/yaml/json/layout/attribute/type.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,20 +254,6 @@
]
}
},
{
"generate_name": "src",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_LINK",
"reserved_values": "",
"type": "AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY",
"text": {
"en": [
"link"
],
"fa": [
"لینک"
]
}
},
{
"generate_name": "label",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_LABEL",
Expand Down
6 changes: 2 additions & 4 deletions config/yaml/json/layout/type.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"id": "AST_LAYOUT_TYPE_LINK",
"is_single": false,
"attributes": [
"AST_LAYOUT_ATTRIBUTE_TYPE_HREF",
"AST_LAYOUT_ATTRIBUTE_TYPE_LINK"
"AST_LAYOUT_ATTRIBUTE_TYPE_HREF"
],
"text": {
"en": [
Expand Down Expand Up @@ -885,8 +884,7 @@
]
},
"attributes": [
"AST_LAYOUT_ATTRIBUTE_TYPE_SRC",
"AST_LAYOUT_ATTRIBUTE_TYPE_LINK"
"AST_LAYOUT_ATTRIBUTE_TYPE_SRC"
]
},
{
Expand Down
9 changes: 0 additions & 9 deletions config/yaml/layout/attribute/type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,6 @@ items:
- src
fa:
- منبع
- generate_name: src
id: AST_LAYOUT_ATTRIBUTE_TYPE_LINK
reserved_values: ''
type: AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY
text:
en:
- link
fa:
- لینک
- generate_name: label
id: AST_LAYOUT_ATTRIBUTE_TYPE_LABEL
reserved_values: ''
Expand Down
2 changes: 0 additions & 2 deletions config/yaml/layout/type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ items:
is_single: false
attributes:
- AST_LAYOUT_ATTRIBUTE_TYPE_HREF
- AST_LAYOUT_ATTRIBUTE_TYPE_LINK
text:
en:
- link
Expand Down Expand Up @@ -605,7 +604,6 @@ items:
- تصویر
attributes:
- AST_LAYOUT_ATTRIBUTE_TYPE_SRC
- AST_LAYOUT_ATTRIBUTE_TYPE_LINK
- descriptions: ''
examples: ''
generate_name: font
Expand Down
5 changes: 5 additions & 0 deletions example/image.salam
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
منبع="https://editor.salamlang.ir/images/favicon.svg"
تمام

جعبه:
رنگ پس زمینه = «زرد»

تمام

تمام
2 changes: 0 additions & 2 deletions src/generated-config/ast_layout_attribute_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_HREF, "HREF", "href", "من

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_SRC, "SRC", "src", "منبع", "src", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL, AST_LAYOUT_ATTRIBUTE_VALUE_HANDLER_SIMPLE)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_LINK, "LINK", "link", "لینک", "src", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL, AST_LAYOUT_ATTRIBUTE_VALUE_HANDLER_SIMPLE)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_LABEL, "LABEL", "label", "برچسب", "label", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL, AST_LAYOUT_ATTRIBUTE_VALUE_HANDLER_SIMPLE)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_REPEAT, "REPEAT", "repeat", "تکرار", "repeat", AST_LAYOUT_ATTRIBUTE_FILTER_NUMBER, NULL, NULL, AST_LAYOUT_ATTRIBUTE_VALUE_HANDLER_SIMPLE)
Expand Down
1 change: 1 addition & 0 deletions src/generated-config/ast_layout_type_attributes_all.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ layout_map_entry_t layout_map[] = {
{ AST_LAYOUT_TYPE_MEDIA, valid_attributes_media, valid_attributes_media_length },

// ----------- END AUTO GENERATED ----------- //

};

const size_t map_size = sizeof(layout_map) / sizeof(layout_map[0]);
Expand Down
2 changes: 0 additions & 2 deletions src/generated-config/ast_layout_type_attributes_values.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// ----------- BEGIN AUTO GENERATED ----------- //
ast_layout_attribute_type_t valid_attributes_link[] = {
AST_LAYOUT_ATTRIBUTE_TYPE_HREF,
AST_LAYOUT_ATTRIBUTE_TYPE_LINK,
};
const size_t valid_attributes_link_length = sizeof(valid_attributes_link) / sizeof(valid_attributes_link[0]);

Expand Down Expand Up @@ -212,7 +211,6 @@ const size_t valid_attributes_input_length = sizeof(valid_attributes_input) / si

ast_layout_attribute_type_t valid_attributes_img[] = {
AST_LAYOUT_ATTRIBUTE_TYPE_SRC,
AST_LAYOUT_ATTRIBUTE_TYPE_LINK,
};
const size_t valid_attributes_img_length = sizeof(valid_attributes_img) / sizeof(valid_attributes_img[0]);

Expand Down
15 changes: 11 additions & 4 deletions src/generator_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,10 +819,17 @@ string_t *generator_code_layout_attributes(generator_t *generator,
string_append_char(html_attributes, ' ');
}

string_append_str(
html_attributes,
attribute->final_key); // TODO: Why name lowercase
// entry->key?
// TODO: Why name lowercase entry->key?
if (attribute->final_key == NULL) {
string_append_str(
html_attributes,
entry->key);
} else {
string_append_str(
html_attributes,
attribute->final_key);
}

string_append_str(html_attributes, "=");

if (attribute_value_length > 1) {
Expand Down

0 comments on commit f5d81a3

Please sign in to comment.