mirror of
https://github.com/SphericalKat/medium.rip.git
synced 2024-12-26 17:45:57 +00:00
fix(mobile): restrict maximum width
Signed-off-by: Sphericalkat <amolele@gmail.com>
This commit is contained in:
parent
264410c8d7
commit
45f3b842c8
@ -14,7 +14,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="flex justify-center">
|
<body class="flex justify-center">
|
||||||
<article class="flex flex-col h-full w-full justify-center prose">
|
<article class="flex flex-col h-full w-full justify-center prose px-8 md:px-0">
|
||||||
<div>
|
<div>
|
||||||
<h1>Medium.rip</h1>
|
<h1>Medium.rip</h1>
|
||||||
<h2>An alternative frontend to Medium</h2>
|
<h2>An alternative frontend to Medium</h2>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="flex flex-col h-full w-full items-center">
|
<body class="flex flex-col h-full w-full items-center">
|
||||||
<article class="prose lg:prose-lg sm:prose-sm py-20">
|
<article class="prose lg:prose-lg sm:prose-sm py-20 px-8 md:px-0 max-w-sm sm:max-w-none">
|
||||||
<h1 class="text-2xl">{{.Title}}</h1>
|
<h1 class="text-2xl">{{.Title}}</h1>
|
||||||
<p class="pb-8"><a href="https://medium.com/u/{{.UserId}}">{{.Author}}</a> on {{.PublishDate}}</p>
|
<p class="pb-8"><a href="https://medium.com/u/{{.UserId}}">{{.Author}}</a> on {{.PublishDate}}</p>
|
||||||
{{.Paragraphs}}
|
{{.Paragraphs}}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package converters
|
package converters
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/medium.rip/pkg/entities"
|
"github.com/medium.rip/pkg/entities"
|
||||||
@ -59,32 +58,20 @@ func TestRanges(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestConvert(t *testing.T) {
|
func TestConvert(t *testing.T) {
|
||||||
jsonData := `{
|
markup := ConvertMarkup("<strong> and emphasized only", []entities.Markup{
|
||||||
"name": "254a",
|
{
|
||||||
"text": "Early Flush prevents subsequent changes to the headers (e.g to redirect or change the status code). In the React + NodeJS world, it’s common to delegate redirects and error throwing to a React app rendered after the data has been fetched. This won’t work if you’ve already sent an early <head> tag and a 200 OK status.",
|
Type: "STRONG",
|
||||||
"type": "P",
|
Start: 0,
|
||||||
"href": null,
|
End: 12,
|
||||||
"layout": null,
|
},
|
||||||
"markups": [
|
{
|
||||||
{
|
Type: "EM",
|
||||||
"title": null,
|
Start: 9,
|
||||||
"type": "CODE",
|
End: 23,
|
||||||
"href": null,
|
},
|
||||||
"userId": null,
|
})
|
||||||
"start": 287,
|
|
||||||
"end": 293,
|
|
||||||
"anchorType": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"iframe": null,
|
|
||||||
"metadata": null
|
|
||||||
}`
|
|
||||||
p := new(entities.Paragraph)
|
|
||||||
_ = json.Unmarshal([]byte(jsonData), p)
|
|
||||||
|
|
||||||
ConvertMarkup(p.Text, p.Markups)
|
if markup != "<strong><strong> </strong><em><strong>and</strong></em><em> emphasized</em> only" {
|
||||||
|
t.Errorf("Expected markup to be <strong><strong> </strong><em><strong>and</strong></em><em> emphasized</em> only only, got %s", markup)
|
||||||
// if markup != "<strong>strong </strong><em><strong>and</strong></em><em> emphasized</em> only" {
|
}
|
||||||
// t.Errorf("Expected markup to be <strong>strong </strong><em><strong>and</strong></em><em> emphasized</em> only, got %s", markup)
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
@ -107,9 +107,6 @@ func ConvertParagraphs(paragraphs []entities.Paragraph) string {
|
|||||||
ps.WriteString(fmt.Sprintf("<ul>%s</ul>", listItems))
|
ps.WriteString(fmt.Sprintf("<ul>%s</ul>", listItems))
|
||||||
case "P":
|
case "P":
|
||||||
children := ConvertMarkup(p.Text, p.Markups)
|
children := ConvertMarkup(p.Text, p.Markups)
|
||||||
if p.Name == "ca5b" {
|
|
||||||
fmt.Println(children)
|
|
||||||
}
|
|
||||||
ps.WriteString(fmt.Sprintf("<p>%s</p>", children))
|
ps.WriteString(fmt.Sprintf("<p>%s</p>", children))
|
||||||
case "PRE":
|
case "PRE":
|
||||||
children := ConvertMarkup(p.Text, p.Markups)
|
children := ConvertMarkup(p.Text, p.Markups)
|
||||||
|
Loading…
Reference in New Issue
Block a user