forked from glitch-soc/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'merge-upstream' into glitch-soc-main
- Loading branch information
Showing
51 changed files
with
10,943 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,5 @@ yarn-debug.log | |
|
||
# Ignore Docker option files | ||
docker-compose.override.yml | ||
|
||
public/MathJax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
app/javascript/flavours/glitch/components/autosuggest_latex.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const assetHost = process.env.CDN_HOST || ''; | ||
|
||
export default class AutosuggestLatex extends React.PureComponent { | ||
|
||
static propTypes = { | ||
latex: PropTypes.object.isRequired, | ||
}; | ||
|
||
setRef = (c) => { | ||
this.node = c; | ||
} | ||
|
||
componentDidMount() { | ||
try { | ||
MathJax.typeset([this.node]); | ||
} catch(e) { | ||
console.error(e); | ||
} | ||
|
||
} | ||
|
||
render () { | ||
const { latex } = this.props; | ||
|
||
return ( | ||
<div className='autosuggest-latex' ref={this.setRef}> | ||
\({latex.expression}\) | ||
<br/> | ||
<small>Convert to unicode</small> | ||
</div> | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.