mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 04:12:10 +00:00
Fix nil context in RenderMarkdownToHtml (#23092)
Fix #23082. This bug is caused by a nil context in https://github.com/go-gitea/gitea/issues/23082#issuecomment-1441276546 . --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
045becf9aa
commit
a6175b01d9
13 changed files with 24 additions and 23 deletions
|
@ -1,7 +1,7 @@
|
|||
<div class="field">
|
||||
{{template "repo/issue/fields/header" .}}
|
||||
{{$field := .}}
|
||||
{{range $i, $opt := .Attributes.options}}
|
||||
{{range $i, $opt := .item.Attributes.options}}
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="form-field-{{$field.ID}}-{{$i}}" {{if $opt.required}}readonly checked{{end}}>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<div class="field">
|
||||
{{template "repo/issue/fields/header" .}}
|
||||
{{/* FIXME: required validation */}}
|
||||
<div class="ui fluid selection dropdown {{if .Attributes.multiple}}multiple clearable{{end}}">
|
||||
<input type="hidden" name="form-field-{{.ID}}" value="0">
|
||||
<div class="ui fluid selection dropdown {{if .item.Attributes.multiple}}multiple clearable{{end}}">
|
||||
<input type="hidden" name="form-field-{{.item.ID}}" value="0">
|
||||
<i class="dropdown icon"></i>
|
||||
<div class="default text"></div>
|
||||
<div class="menu">
|
||||
{{range $i, $opt := .Attributes.options}}
|
||||
{{range $i, $opt := .item.Attributes.options}}
|
||||
<div class="item" data-value="{{$i}}">{{$opt}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{if .Attributes.label}}
|
||||
<h3>{{.Attributes.label}}{{if .Validations.required}}<label class="required"></label>{{end}}</h3>
|
||||
{{if .item.Attributes.label}}
|
||||
<h3>{{.item.Attributes.label}}{{if .item.Validations.required}}<label class="required"></label>{{end}}</h3>
|
||||
{{end}}
|
||||
{{if .Attributes.description}}
|
||||
<span class="help">{{RenderMarkdownToHtml .Attributes.description}}</span>
|
||||
{{if .item.Attributes.description}}
|
||||
<span class="help">{{RenderMarkdownToHtml .Context .item.Attributes.description}}</span>
|
||||
{{end}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="field">
|
||||
{{template "repo/issue/fields/header" .}}
|
||||
<input type="{{if .Validations.is_number}}number{{else}}text{{end}}" name="form-field-{{.ID}}" placeholder="{{.Attributes.placeholder}}" value="{{.Attributes.value}}" {{if .Validations.required}}required{{end}} {{if .Validations.regex}}pattern="{{.Validations.regex}}" title="{{.Validations.regex}}"{{end}}>
|
||||
<input type="{{if .item.Validations.is_number}}number{{else}}text{{end}}" name="form-field-{{.item.ID}}" placeholder="{{.item.Attributes.placeholder}}" value="{{.item.Attributes.value}}" {{if .item.Validations.required}}required{{end}} {{if .item.Validations.regex}}pattern="{{.item.Validations.regex}}" title="{{.item.Validations.regex}}"{{end}}>
|
||||
</div>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<div class="field">
|
||||
<div>{{RenderMarkdownToHtml .Attributes.value}}</div>
|
||||
<div>{{RenderMarkdownToHtml .Context .item.Attributes.value}}</div>
|
||||
</div>
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
{{template "repo/issue/fields/header" .}}
|
||||
{{/* FIXME: preview markdown result */}}
|
||||
{{/* FIXME: required validation for markdown editor */}}
|
||||
<textarea name="form-field-{{.ID}}" placeholder="{{.Attributes.placeholder}}" class="edit_area {{if .Attributes.render}}no-easymde{{end}}" {{if and .Validations.required .Attributes.render}}required{{end}}>{{.Attributes.value}}</textarea>
|
||||
<textarea name="form-field-{{.item.ID}}" placeholder="{{.item.Attributes.placeholder}}" class="edit_area {{if .item.Attributes.render}}no-easymde{{end}}" {{if and .item.Validations.required .item.Attributes.render}}required{{end}}>{{.item.Attributes.value}}</textarea>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue